Blender's GPU Accelerated UI, Decoupled from it's original codebase. Supports Rust, Python, JS, React, C & C++. Twice as good as GPUI
feat: virtualization components
Preetham Pemmasani43fce4b157ff
diff --git a/bindings/rust/Cargo.lock b/bindings/rust/Cargo.lockindex 1512663..fbb99e6 100644--- a/bindings/rust/Cargo.lock+++ b/bindings/rust/Cargo.lock@@ -41,7 +41,9 @@ version = "0.2.0"dependencies = ["blenderui-macros","blenderui-sys",+ "blenderui-table","blenderui-tailwind",+ "blenderui-vlist","paste","png","smallvec",@@ -80,6 +82,10 @@ dependencies = ["napi-derive",]+[[package]]+name = "blenderui-paint"+version = "0.2.0"+[[package]]name = "blenderui-qjs"version = "0.2.0"@@ -96,10 +102,24 @@ dependencies = ["cmake",]+[[package]]+name = "blenderui-table"+version = "0.2.0"+dependencies = [+ "blenderui-paint",+]+[[package]]name = "blenderui-tailwind"version = "0.2.0"+[[package]]+name = "blenderui-vlist"+version = "0.2.0"+dependencies = [+ "blenderui-paint",+]+[[package]]name = "cc"version = "1.11.0"diff --git a/bindings/rust/Cargo.toml b/bindings/rust/Cargo.tomlindex 1a0ba07..f43e3ce 100644--- a/bindings/rust/Cargo.toml+++ b/bindings/rust/Cargo.toml@@ -1,7 +1,7 @@[workspace]resolver = "2"-members = ["blenderui-sys", "blenderui-tailwind", "blenderui-macros", "blenderui", "blenderui-jsview", "blenderui-node", "blenderui-qjs", "blenderui-imgui"]-exclude = ["bench"]+members = ["blenderui-paint", "blenderui-vlist", "blenderui-table", "blenderui-sys", "blenderui-tailwind", "blenderui-macros", "blenderui", "blenderui-jsview", "blenderui-node", "blenderui-qjs", "blenderui-imgui"]+exclude = ["bench", "blenderui-table-gpui"][workspace.package]version = "0.2.0"diff --git a/bindings/rust/bench/README.md b/bindings/rust/bench/README.mdindex 4e3d16b..d947056 100644--- a/bindings/rust/bench/README.md+++ b/bindings/rust/bench/README.md@@ -191,3 +191,7 @@ Fourth round (reuse across frames, fewer allocations):| Painter, text buffer, layout scratch, box index table reused across frames; small lists on the stack | allocations per frame no longer grow with text items |Still single-threaded and the largest remaining costs are the cascade, box tree and taffy layout (about 20 ms at 3000 cells): incremental restyling and layout would be the next step.++## Data table against gpui-component++The data-table head-to-head (the same gpui, same data, a real window) lives in [blenderui-table-gpui](../blenderui-table-gpui/README.md): `examples/bench_gpui.rs` and `bench/run.mjs`. It reuses this directory's `common/measure.rs` for CPU cycles and memory.diff --git a/bindings/rust/bench/common/measure.rs b/bindings/rust/bench/common/measure.rsindex 26ad393..b7cb2cf 100644--- a/bindings/rust/bench/common/measure.rs+++ b/bindings/rust/bench/common/measure.rs@@ -96,18 +96,18 @@ struct FileTime {#[repr(C)]#[derive(Default)]-struct MemCounters {+pub struct MemCounters {cb: u32,page_faults: u32,- peak_working_set: usize,- working_set: usize,+ pub peak_working_set: usize,+ pub working_set: usize,quota_peak_paged: usize,quota_paged: usize,quota_peak_nonpaged: usize,quota_nonpaged: usize,pagefile: usize,peak_pagefile: usize,- private_bytes: usize,+ pub private_bytes: usize,}#[link(name = "kernel32")]@@ -121,14 +121,14 @@ unsafe extern "system" {/// CPU cycles used by every thread of the process. Unlike GetProcessTimes/// (charged per ~15.6 ms clock tick, which aliases with a 60 Hz frame loop)/// this is exact; `tsc_hz` turns it into time.-fn cpu_cycles() -> u64 {+pub fn cpu_cycles() -> u64 {let mut c = 0u64;unsafe { QueryProcessCycleTime(GetCurrentProcess(), &mut c) };c}/// The cycle counter's frequency, measured against the wall clock.-fn tsc_hz(over: Duration) -> f64 {+pub fn tsc_hz(over: Duration) -> f64 {let (t0, c0) = (Instant::now(), unsafe { core::arch::x86_64::_rdtsc() });std::thread::sleep(over);let (t1, c1) = (Instant::now(), unsafe { core::arch::x86_64::_rdtsc() });@@ -143,7 +143,7 @@ fn cpu_time() -> Duration {Duration::from_nanos(t(&k) + t(&u))}-fn memory() -> MemCounters {+pub fn memory() -> MemCounters {let mut m = MemCounters { cb: std::mem::size_of::<MemCounters>() as u32, ..Default::default() };unsafe { K32GetProcessMemoryInfo(GetCurrentProcess(), &mut m, m.cb) };mdiff --git a/bindings/rust/blenderui-paint-gpui/Cargo.toml b/bindings/rust/blenderui-paint-gpui/Cargo.tomlnew file mode 100644index 0000000..d564d41--- /dev/null+++ b/bindings/rust/blenderui-paint-gpui/Cargo.toml@@ -0,0 +1,20 @@+[package]+name = "blenderui-paint-gpui"+description = "A gpui PaintSink: paints the BUI view cores (table, variable list) straight into a gpui window's scene"+version = "0.2.0"+edition = "2024"+license = "GPL-2.0-or-later"+repository = "https://github.com/ppmpreetham/BUI"+homepage = "https://bui.preetham.top"+authors = ["BUI contributors"]+rust-version = "1.88"+keywords = ["gpui", "paint", "blender"]+categories = ["gui"]+publish = false++# its own workspace: like the other gpui crates, it never enters the normal CI builds+[workspace]++[dependencies]+blenderui-paint = { path = "../blenderui-paint", version = "0.2.0" }+gpui = { package = "gpui-pre", version = "=0.3.11" }diff --git a/bindings/rust/blenderui-paint-gpui/src/lib.rs b/bindings/rust/blenderui-paint-gpui/src/lib.rsnew file mode 100644index 0000000..664dc7b--- /dev/null+++ b/bindings/rust/blenderui-paint-gpui/src/lib.rs@@ -0,0 +1,125 @@+//! The gpui side of painting, shared by every core-driven gpui view (the data+//! table, the variable list): a [`PaintSink`] that paints straight into the+//! window scene (`Window::paint_quad`, shaped lines), with a text-run cache so+//! a scrolling view never reshapes a string it showed a frame ago.++use blenderui_paint::{PaintSink, Rect, Rgba as CoreRgba, TextCache};+use gpui::{+ App, Bounds, BorderStyle, ContentMask, Font, Hsla, PathBuilder, Pixels, Point, ShapedLine, SharedString, TextAlign,+ TextRun, Window, point, px, quad, size, transparent_black,+};++/// Line height as a multiple of the font size.+const LINE_HEIGHT: f32 = 1.3;++/// The cache key's "style" for a text color: the table's main text color is 0.+fn style_key(c: CoreRgba, text: CoreRgba) -> u32 {+ if c == text {+ return 0;+ }+ let b = |v: f32| (v.clamp(0.0, 1.0) * 255.0).round() as u32;+ // 0 is taken; fold the channels into the rest of the range+ 1 + ((b(c.r) << 24 | b(c.g) << 16 | b(c.b) << 8 | b(c.a)) >> 1)+}++fn hsla(c: CoreRgba) -> Hsla {+ gpui::Rgba { r: c.r, g: c.g, b: c.b, a: c.a }.into()+}++/// Draws into a gpui window at `origin`.+pub struct GpuiSink<'a> {+ window: &'a mut Window,+ cx: &'a mut App,+ origin: Point<Pixels>,+ text: &'a mut TextCache<ShapedLine>,+ font: &'a Font,+ /// The table's main text color (cache style 0).+ main: CoreRgba,+}++impl<'a> GpuiSink<'a> {+ pub const fn new(+ window: &'a mut Window,+ cx: &'a mut App,+ origin: Point<Pixels>,+ text: &'a mut TextCache<ShapedLine>,+ font: &'a Font,+ main: CoreRgba,+ ) -> Self {+ Self { window, cx, origin, text, font, main }+ }++ fn bounds(&self, r: Rect) -> Bounds<Pixels> {+ Bounds { origin: point(self.origin.x + px(r.x), self.origin.y + px(r.y)), size: size(px(r.w), px(r.h)) }+ }+}++/// The shaped line for `text`, from the cache or shaped now.+fn shaped<'c>(+ cache: &'c mut TextCache<ShapedLine>,+ window: &Window,+ font: &Font,+ text: &str,+ key: u32,+ size_px: f32,+ color: Hsla,+) -> &'c ShapedLine {+ cache.get_or_insert_with(text, key, size_px, || {+ let run = TextRun { len: text.len(), font: font.clone(), color, background_color: None, underline: None, strikethrough: None };+ window.text_system().shape_line(SharedString::from(text.to_owned()), px(size_px), &[run], None)+ })+}++impl PaintSink for GpuiSink<'_> {+ fn fill(&mut self, r: Rect, c: CoreRgba) {+ if c.a > 0.0 && r.w > 0.0 && r.h > 0.0 {+ let b = self.bounds(r);+ self.window.paint_quad(gpui::fill(b, hsla(c)));+ }+ }++ fn stroke(&mut self, r: Rect, c: CoreRgba, width: f32) {+ let b = self.bounds(r);+ self.window.paint_quad(quad(b, px(0.0), transparent_black(), px(width), hsla(c), BorderStyle::Solid));+ }++ fn round(&mut self, r: Rect, radius: f32, c: CoreRgba) {+ let b = self.bounds(r);+ self.window.paint_quad(quad(b, px(radius), hsla(c), px(0.0), transparent_black(), BorderStyle::Solid));+ }++ fn line(&mut self, a: (f32, f32), b: (f32, f32), c: CoreRgba, width: f32) {+ let o = self.origin;+ let mut path = PathBuilder::stroke(px(width));+ path.move_to(point(o.x + px(a.0), o.y + px(a.1)));+ path.line_to(point(o.x + px(b.0), o.y + px(b.1)));+ if let Ok(path) = path.build() {+ self.window.paint_path(path, hsla(c));+ }+ }++ fn text(&mut self, x: f32, cy: f32, text: &str, size_px: f32, c: CoreRgba) {+ if text.trim().is_empty() {+ return;+ }+ let key = style_key(c, self.main);+ let line_h = px(size_px * LINE_HEIGHT);+ let line = shaped(self.text, self.window, self.font, text, key, size_px, hsla(c));+ let origin = point(self.origin.x + px(x), self.origin.y + px(cy) - line_h / 2.0);+ let _ = line.paint(origin, line_h, TextAlign::Left, None, self.window, self.cx);+ }++ fn text_width(&mut self, text: &str, size_px: f32) -> f32 {+ let main = hsla(self.main);+ f32::from(shaped(self.text, self.window, self.font, text, 0, size_px, main).width())+ }++ fn clipped(&mut self, r: Rect, f: &mut dyn FnMut(&mut dyn PaintSink)) {+ let mask = ContentMask { bounds: self.bounds(r) };+ let Self { window, cx, origin, text, font, main } = self;+ let (origin, font, main) = (*origin, *font, *main);+ window.with_content_mask(Some(mask), |window| {+ f(&mut GpuiSink { window, cx, origin, text, font, main });+ });+ }+}diff --git a/bindings/rust/blenderui-paint/Cargo.toml b/bindings/rust/blenderui-paint/Cargo.tomlnew file mode 100644index 0000000..371b860--- /dev/null+++ b/bindings/rust/blenderui-paint/Cargo.toml@@ -0,0 +1,46 @@+[package]+name = "blenderui-paint"+description = "The paint vocabulary shared by BUI's framework-independent view cores: geometry, colors, the PaintSink trait and a bounded text-run cache"+version.workspace = true+edition.workspace = true+license.workspace = true+repository.workspace = true+homepage.workspace = true+authors.workspace = true+rust-version.workspace = true+documentation = "https://docs.rs/blenderui-paint"+keywords = ["gui", "paint", "text-cache", "blender"]+categories = ["gui", "data-structures"]+readme = "README.md"+include = ["src/**", "README.md", "Cargo.toml"]+publish = false++[dependencies]++[lints.clippy]+all = { level = "warn", priority = -2 }+pedantic = { level = "warn", priority = -2 }+perf = { level = "warn", priority = -1 }+complexity = { level = "warn", priority = -1 }+inline_always = "allow"+unseparated_literal_suffix = "allow"+similar_names = "allow"+missing_panics_doc = "allow"+missing_errors_doc = "allow"+absolute_paths = "allow"+module_name_repetitions = "allow"+doc_markdown = "allow"+too_many_lines = "allow"+unused_self = "allow"+cast_possible_truncation = "allow"+cast_sign_loss = "allow"+cast_precision_loss = "allow"+unreadable_literal = "allow"+implicit_hasher = "allow"+significant_drop_tightening = "warn"+redundant_clone = "warn"+use_self = "warn"+redundant_else = "warn"+or_fun_call = "warn"+missing_const_for_fn = "warn"+derive_partial_eq_without_eq = "warn"diff --git a/bindings/rust/blenderui-paint/README.md b/bindings/rust/blenderui-paint/README.mdnew file mode 100644index 0000000..9392a81--- /dev/null+++ b/bindings/rust/blenderui-paint/README.md@@ -0,0 +1,10 @@+# blenderui-paint++The small vocabulary every BUI view core paints with, in one place: `Point`,+`Rect`, `Rgba`, the `PaintSink` trait (an adapter implements it once per UI+framework) and `TextCache`, a bounded generation-tagged text-run cache (the+design of Blender's BLF glyph cache, lifted to runs). `blenderui-table` and+`blenderui-vlist` both depend on it; neither copies it. `std` only.++`testing` holds the seeded `Rng` and the counting allocator the cores' tests+share (allocation-count assertions).diff --git a/bindings/rust/blenderui-paint/src/geom.rs b/bindings/rust/blenderui-paint/src/geom.rsnew file mode 100644index 0000000..8950773--- /dev/null+++ b/bindings/rust/blenderui-paint/src/geom.rs@@ -0,0 +1,56 @@+//! The few geometry and color types the core needs. Plain `f32` logical+//! pixels; adapters convert to their framework's types at the paint sink.++/// A point.+#[derive(Copy, Clone, Debug, Default, PartialEq)]+pub struct Point {+ pub x: f32,+ pub y: f32,+}++/// A rectangle: left, top, width, height.+#[derive(Copy, Clone, Debug, Default, PartialEq)]+pub struct Rect {+ pub x: f32,+ pub y: f32,+ pub w: f32,+ pub h: f32,+}++impl Rect {+ #[must_use]+ pub const fn new(x: f32, y: f32, w: f32, h: f32) -> Self {+ Self { x, y, w, h }+ }+}++/// A color with straight alpha, channels in `0..=1`.+#[derive(Copy, Clone, Debug, Default, PartialEq)]+pub struct Rgba {+ pub r: f32,+ pub g: f32,+ pub b: f32,+ pub a: f32,+}++impl Rgba {+ pub const TRANSPARENT: Self = Self { r: 0.0, g: 0.0, b: 0.0, a: 0.0 };++ #[must_use]+ pub const fn new(r: f32, g: f32, b: f32, a: f32) -> Self {+ Self { r, g, b, a }+ }++ /// Alpha multiplied by `factor`.+ #[must_use]+ pub fn opacity(self, factor: f32) -> Self {+ Self { a: self.a * factor, ..self }+ }++ /// Blender's `shade`: add `offset / 255` to each color channel.+ #[must_use]+ pub fn shade(self, offset: f32) -> Self {+ let o = offset / 255.0;+ Self { r: (self.r + o).clamp(0.0, 1.0), g: (self.g + o).clamp(0.0, 1.0), b: (self.b + o).clamp(0.0, 1.0), a: self.a }+ }+}diff --git a/bindings/rust/blenderui-paint/src/lib.rs b/bindings/rust/blenderui-paint/src/lib.rsnew file mode 100644index 0000000..15819e7--- /dev/null+++ b/bindings/rust/blenderui-paint/src/lib.rs@@ -0,0 +1,22 @@+//! The paint vocabulary shared by BUI's framework-independent view cores+//! (`blenderui-table`, `blenderui-vlist`): geometry and colors ([`geom`]),+//! the [`PaintSink`] a UI framework implements once, and the bounded+//! [`TextCache`]. One source of truth; the cores re-export what their own+//! users need. `std` only.++#![allow(clippy::float_cmp, clippy::many_single_char_names, clippy::cast_possible_wrap)]++pub mod geom;+pub mod palette;+pub mod sink;+pub mod testing;+pub mod text_cache;++pub use geom::{Point, Rect, Rgba};+pub use palette::Palette;+pub use sink::PaintSink;+pub use text_cache::TextCache;++#[cfg(test)]+#[global_allocator]+static ALLOC: testing::Counting = testing::Counting;diff --git a/bindings/rust/blenderui-paint/src/palette.rs b/bindings/rust/blenderui-paint/src/palette.rsnew file mode 100644index 0000000..af09d73--- /dev/null+++ b/bindings/rust/blenderui-paint/src/palette.rs@@ -0,0 +1,52 @@+//! Theme colors a view paints with, derived the way Blender derives its+//! editor colors (`TH_BACK` shaded for headers and lines).++use crate::geom::Rgba;++/// Theme colors a view uses.+#[derive(Copy, Clone, Debug, PartialEq)]+pub struct Palette {+ pub back: Rgba,+ pub header: Rgba,+ pub line: Rgba,+ pub alt: Rgba,+ pub text: Rgba,+ pub dim: Rgba,+ pub sel: Rgba,+ pub hover: Rgba,+ pub accent: Rgba,+}++impl Palette {+ /// Blender's default dark theme (`region_bg`, `text`, `file_row_alternate`, `list_item`).+ #[must_use]+ pub fn blender_dark() -> Self {+ let c = |r: u8, g: u8, b: u8, a: f32| Rgba::new(f32::from(r) / 255.0, f32::from(g) / 255.0, f32::from(b) / 255.0, a);+ Self::new(c(29, 29, 29, 1.0), c(230, 230, 230, 1.0), c(255, 255, 255, 0.03), c(77, 112, 179, 1.0), c(77, 140, 217, 1.0))+ }++ /// Blender's default light theme.+ #[must_use]+ pub fn blender_light() -> Self {+ let c = |r: u8, g: u8, b: u8, a: f32| Rgba::new(f32::from(r) / 255.0, f32::from(g) / 255.0, f32::from(b) / 255.0, a);+ Self::new(c(153, 153, 153, 1.0), c(0, 0, 0, 1.0), c(0, 0, 0, 0.04), c(77, 112, 179, 1.0), c(77, 140, 217, 1.0))+ }++ /// A palette from the five colors a theme gives; the rest derives from+ /// them as Blender derives its spreadsheet colors (`TH_BACK` shaded by+ /// 11 for the header, -11 for lines).+ #[must_use]+ pub fn new(back: Rgba, text: Rgba, alt: Rgba, sel: Rgba, accent: Rgba) -> Self {+ Self {+ back,+ header: back.shade(11.0),+ line: back.shade(-11.0),+ alt,+ text,+ dim: text.opacity(0.6),+ sel: Rgba { a: sel.a.max(0.85), ..sel },+ hover: text.opacity(0.07),+ accent,+ }+ }+}diff --git a/bindings/rust/blenderui-paint/src/sink.rs b/bindings/rust/blenderui-paint/src/sink.rsnew file mode 100644index 0000000..7e8d220--- /dev/null+++ b/bindings/rust/blenderui-paint/src/sink.rs@@ -0,0 +1,25 @@+//! The one trait a framework implements to be painted into.++use crate::geom::{Rect, Rgba};++/// Where a view paints. Coordinates are logical pixels relative to the+/// view's top-left; the sink adds its origin. Implemented once per+/// framework.+pub trait PaintSink {+ /// A filled rectangle.+ fn fill(&mut self, r: Rect, c: Rgba);+ /// A rectangle's border, drawn inside it.+ fn stroke(&mut self, r: Rect, c: Rgba, width: f32);+ /// A rounded filled rectangle.+ fn round(&mut self, r: Rect, radius: f32, c: Rgba);+ /// A straight line.+ fn line(&mut self, a: (f32, f32), b: (f32, f32), c: Rgba, width: f32);+ /// Text starting at `x`, its line box vertically centered on `cy`.+ fn text(&mut self, x: f32, cy: f32, text: &str, size: f32, c: Rgba);+ /// The width of `text` at `size`.+ fn text_width(&mut self, text: &str, size: f32) -> f32;+ /// Run `f` with drawing restricted to `r` (intersected with any clip in+ /// force). It receives the sink to draw into, which may be a different+ /// object than `self` (a framework scopes its clip with a closure).+ fn clipped(&mut self, r: Rect, f: &mut dyn FnMut(&mut dyn PaintSink));+}diff --git a/bindings/rust/blenderui-paint/src/testing.rs b/bindings/rust/blenderui-paint/src/testing.rsnew file mode 100644index 0000000..7fd4863--- /dev/null+++ b/bindings/rust/blenderui-paint/src/testing.rs@@ -0,0 +1,67 @@+//! Helpers the cores' tests share: a seeded generator and a counting+//! allocator. A test binary installs the allocator itself+//! (`#[global_allocator] static A: Counting = Counting;`) and then asks+//! [`count_allocs`] how often a closure hit the heap.++use std::alloc::{GlobalAlloc, Layout, System};+use std::cell::Cell;++/// A xorshift generator: seeded, so failures reproduce.+pub struct Rng(u64);++impl Rng {+ #[must_use]+ pub const fn new(seed: u64) -> Self {+ Self(seed.wrapping_mul(0x9E37_79B9_7F4A_7C15) | 1)+ }++ #[allow(clippy::should_implement_trait)]+ pub const fn next(&mut self) -> u64 {+ self.0 ^= self.0 << 13;+ self.0 ^= self.0 >> 7;+ self.0 ^= self.0 << 17;+ self.0+ }++ /// Uniform-ish in `0..n` (`n > 0`).+ pub const fn below(&mut self, n: u64) -> u64 {+ self.next() % n+ }+}++/// The counting allocator (see the module docs).+pub struct Counting;++thread_local! {+ static ARMED: Cell<bool> = const { Cell::new(false) };+ static COUNT: Cell<usize> = const { Cell::new(0) };+}++// SAFETY: forwards to the system allocator; the counters are const-initialised+// thread-locals without destructors, so counting never allocates.+unsafe impl GlobalAlloc for Counting {+ unsafe fn alloc(&self, l: Layout) -> *mut u8 {+ if ARMED.get() {+ COUNT.set(COUNT.get() + 1);+ }+ unsafe { System.alloc(l) }+ }+ unsafe fn dealloc(&self, p: *mut u8, l: Layout) {+ unsafe { System.dealloc(p, l) }+ }+ unsafe fn realloc(&self, p: *mut u8, l: Layout, n: usize) -> *mut u8 {+ if ARMED.get() {+ COUNT.set(COUNT.get() + 1);+ }+ unsafe { System.realloc(p, l, n) }+ }+}++/// Allocations made by this thread while `f` runs (needs [`Counting`] installed).+pub fn count_allocs(f: impl FnOnce()) -> usize {+ COUNT.set(0);+ ARMED.set(true);+ f();+ ARMED.set(false);+ COUNT.get()+}diff --git a/bindings/rust/blenderui-paint/src/text_cache.rs b/bindings/rust/blenderui-paint/src/text_cache.rsnew file mode 100644index 0000000..c49287a--- /dev/null+++ b/bindings/rust/blenderui-paint/src/text_cache.rs@@ -0,0 +1,229 @@+//! A text-run cache: the design of Blender's font glyph cache+//! (`blf_glyph.cc`: a bounded cache keyed by font, size and glyph, filled on+//! first use, dropped whole when the font changes) lifted to runs. A table+//! shows mostly the same strings frame after frame (scrolling only moves+//! them), so a shaped run, or its measured width, is computed once and found+//! again by `(text, font, size)`.+//!+//! * `V` is whatever the framework wants to keep: a width (`f32`), a shaped+//! line, a glyph run.+//! * Lookups of cached text do not allocate; a miss allocates the key once.+//! * Bounded: entries carry the generation of their last use, and when the+//! cache reaches its capacity the entries unused for a whole generation+//! go (all of them when that frees too little). A generation is one frame+//! ([`TextCache::next_generation`]).+//! * [`TextCache::clear`] is the invalidation for a font, scale or theme change.++use std::collections::HashMap;+use std::hash::{BuildHasherDefault, Hasher};++/// A hasher for keys that are already hashes.+#[derive(Default)]+pub struct KeyHasher(u64);++impl Hasher for KeyHasher {+ fn finish(&self) -> u64 {+ self.0+ }++ fn write(&mut self, bytes: &[u8]) {+ for &b in bytes {+ self.0 = (self.0 ^ u64::from(b)).wrapping_mul(0x100_0000_01b3);+ }+ }++ fn write_u64(&mut self, v: u64) {+ self.0 = v;+ }+}++struct Entry<V> {+ text: Box<str>,+ font: u32,+ size: u32,+ generation: u32,+ value: V,+}++/// See the module docs.+pub struct TextCache<V> {+ map: HashMap<u64, Entry<V>, BuildHasherDefault<KeyHasher>>,+ generation: u32,+ capacity: usize,+ hits: u64,+ misses: u64,+}++/// FNV-1a over the text, mixed with the font and size, then finalized.+fn hash_key(text: &str, font: u32, size: u32) -> u64 {+ let mut h: u64 = 0xcbf2_9ce4_8422_2325 ^ (u64::from(font) << 32 | u64::from(size));+ for &b in text.as_bytes() {+ h = (h ^ u64::from(b)).wrapping_mul(0x100_0000_01b3);+ }+ h ^= h >> 32;+ h = h.wrapping_mul(0x9e37_79b9_7f4a_7c15);+ h ^ (h >> 29)+}++impl<V> TextCache<V> {+ /// A cache holding up to `capacity` runs.+ #[must_use]+ pub fn new(capacity: usize) -> Self {+ Self { map: HashMap::default(), generation: 0, capacity: capacity.max(1), hits: 0, misses: 0 }+ }++ /// Start a new generation (call once per frame).+ pub const fn next_generation(&mut self) {+ self.generation = self.generation.wrapping_add(1);+ }++ /// Make room for at least `n` runs (a table that shows more than the+ /// current capacity needs a cache that holds a screenful and the next).+ pub fn ensure_capacity(&mut self, n: usize) {+ self.capacity = self.capacity.max(n);+ }++ /// Drop everything (the font, scale or theme changed).+ pub fn clear(&mut self) {+ self.map.clear();+ }++ #[must_use]+ pub fn len(&self) -> usize {+ self.map.len()+ }++ #[must_use]+ pub fn is_empty(&self) -> bool {+ self.map.is_empty()+ }++ /// `(hits, misses)` since creation.+ #[must_use]+ pub const fn stats(&self) -> (u64, u64) {+ (self.hits, self.misses)+ }++ fn make_room(&mut self) {+ if self.map.len() < self.capacity {+ return;+ }+ let current = self.generation;+ // keep what the current or the previous generation used+ self.map.retain(|_, e| current.wrapping_sub(e.generation) <= 1);+ if self.map.len() >= self.capacity {+ self.map.clear();+ }+ }++ /// The value for `(text, font, size)` if it is cached (a pure lookup: no+ /// generation bump, no statistics, so it works through a shared reference).+ #[must_use]+ pub fn peek(&self, text: &str, font: u32, size: f32) -> Option<&V> {+ let size_bits = size.to_bits();+ self.map.get(&hash_key(text, font, size_bits)).filter(|e| e.font == font && e.size == size_bits && &*e.text == text).map(|e| &e.value)+ }++ /// The value for `(text, font, size)`, made with `make` on a miss.+ pub fn get_or_insert_with(&mut self, text: &str, font: u32, size: f32, make: impl FnOnce() -> V) -> &V {+ let size_bits = size.to_bits();+ let key = hash_key(text, font, size_bits);+ let generation = self.generation;+ let found = self.map.get_mut(&key).is_some_and(|e| {+ let same = e.font == font && e.size == size_bits && &*e.text == text;+ if same {+ e.generation = generation;+ }+ same+ });+ if found {+ self.hits += 1;+ } else {+ self.misses += 1;+ self.make_room();+ self.map.insert(key, Entry { text: text.into(), font, size: size_bits, generation, value: make() });+ }+ // present: found or just inserted+ &self.map[&key].value+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn hits_do_not_remake() {+ let mut c = TextCache::new(8);+ let mut made = 0;+ for _ in 0..5 {+ let v = *c.get_or_insert_with("hello", 0, 13.0, || {+ made += 1;+ 5.0f32+ });+ assert_eq!(v, 5.0);+ }+ assert_eq!(made, 1);+ assert_eq!(c.stats(), (4, 1));+ }++ #[test]+ fn key_is_text_font_and_size() {+ let mut c = TextCache::new(16);+ c.get_or_insert_with("a", 0, 13.0, || 1);+ c.get_or_insert_with("a", 1, 13.0, || 2);+ c.get_or_insert_with("a", 0, 14.0, || 3);+ c.get_or_insert_with("b", 0, 13.0, || 4);+ assert_eq!(c.len(), 4);+ assert_eq!(*c.get_or_insert_with("a", 1, 13.0, || 99), 2);+ assert_eq!(*c.get_or_insert_with("a", 0, 14.0, || 99), 3);+ }++ #[test]+ fn stays_bounded_and_keeps_recent_entries() {+ let mut c = TextCache::new(100);+ for frame in 0..50u32 {+ c.next_generation();+ // a few runs reused every frame, many new ones+ for i in 0..30u32 {+ c.get_or_insert_with(&format!("hot{i}"), 0, 12.0, || 0u32);+ c.get_or_insert_with(&format!("cold{frame}-{i}"), 0, 12.0, || 0u32);+ }+ assert!(c.len() <= 100, "frame {frame}: {}", c.len());+ }+ // the reused runs survive every sweep+ let (_, misses_before) = c.stats();+ c.next_generation();+ for i in 0..30u32 {+ c.get_or_insert_with(&format!("hot{i}"), 0, 12.0, || 0u32);+ }+ assert_eq!(c.stats().1, misses_before, "hot runs were evicted");+ }++ #[test]+ fn clear_invalidates() {+ let mut c = TextCache::new(4);+ c.get_or_insert_with("x", 0, 1.0, || 1);+ c.clear();+ assert!(c.is_empty());+ assert_eq!(*c.get_or_insert_with("x", 0, 1.0, || 2), 2);+ }++ #[test]+ fn lookups_of_cached_text_do_not_allocate() {+ use crate::testing::count_allocs;+ let mut c = TextCache::new(64);+ let words = ["alpha", "beta", "gamma"];+ for w in words {+ c.get_or_insert_with(w, 0, 12.0, || 1u8);+ }+ let n = count_allocs(|| {+ for _ in 0..100 {+ for w in words {+ c.get_or_insert_with(w, 0, 12.0, || 1u8);+ }+ }+ });+ assert_eq!(n, 0);+ }+}diff --git a/bindings/rust/blenderui-table-gpui/Cargo.lock b/bindings/rust/blenderui-table-gpui/Cargo.locknew file mode 100644index 0000000..91d7e46--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/Cargo.lock@@ -0,0 +1,8369 @@+# This file is automatically @generated by Cargo.+# It is not intended for manual editing.+version = 4++[[package]]+name = "accesskit"+version = "0.24.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d3b7f7f85a7e5f68090000ed7622545829afd484d210358702ae4cb97dd0c320"+dependencies = [+ "enumn",+ "uuid",+]++[[package]]+name = "accesskit_consumer"+version = "0.38.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d10a236f96f87d70732e44520046785431ef01d5bcd6b041317bfadd2f88245"+dependencies = [+ "accesskit",+ "hashbrown 0.16.1",+]++[[package]]+name = "accesskit_macos"+version = "0.26.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ce02dc63b43f0c9296af9ac946312a2dc8814427d7a64d2d600971dac55b6076"+dependencies = [+ "accesskit",+ "accesskit_consumer",+ "hashbrown 0.16.1",+ "objc2 0.5.3",+ "objc2-app-kit 0.2.2",+ "objc2-foundation 0.2.2",+]++[[package]]+name = "accesskit_windows"+version = "0.34.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "106c2b961215864d1c2e703ee63269c25c4e80a577ffb2c1017b9c17dcdf83a1"+dependencies = [+ "accesskit",+ "accesskit_consumer",+ "hashbrown 0.16.1",+ "static_assertions",+ "windows 0.62.2",+ "windows-core 0.62.2",+]++[[package]]+name = "addr2line"+version = "0.27.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e567177890eb1617b1f774005b66b26b2377afd138a2ca37aae7d8f0c81429d4"+dependencies = [+ "gimli",+]++[[package]]+name = "adler2"+version = "2.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"++[[package]]+name = "aes"+version = "0.8.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"+dependencies = [+ "cfg-if",+ "cipher",+ "cpufeatures 0.2.17",+ "zeroize",+]++[[package]]+name = "aho-corasick"+version = "1.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"+dependencies = [+ "memchr",+]++[[package]]+name = "aligned"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685"+dependencies = [+ "as-slice",+]++[[package]]+name = "aligned-vec"+version = "0.6.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b"+dependencies = [+ "equator",+]++[[package]]+name = "alloca"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4"+dependencies = [+ "cc",+]++[[package]]+name = "allocator-api2"+version = "0.2.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"++[[package]]+name = "android_system_properties"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc"+dependencies = [+ "libc",+]++[[package]]+name = "anes"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"++[[package]]+name = "annotate-snippets"+version = "0.12.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b2a5b0a5ab8561c603f16c3b78c24a386b1f70e7fc1b1b1e8c15738828e4a176"+dependencies = [+ "anstyle",+ "memchr",+ "unicode-width",+]++[[package]]+name = "anstyle"+version = "1.0.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"++[[package]]+name = "anyhow"+version = "1.0.104"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"++[[package]]+name = "arbitrary"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed"++[[package]]+name = "arc-swap"+version = "1.9.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "380962b3d93b99642e50b9febf72c071e97e8b32d86eae9cf4ef582bb960ae6e"+dependencies = [+ "rustversion",+]++[[package]]+name = "arg_enum_proc_macro"+version = "0.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "arraydeque"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236"++[[package]]+name = "arrayref"+version = "0.3.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"++[[package]]+name = "arrayvec"+version = "0.7.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"++[[package]]+name = "as-slice"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516"+dependencies = [+ "stable_deref_trait",+]++[[package]]+name = "ash"+version = "0.38.0+1.3.281"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f"+dependencies = [+ "libloading",+]++[[package]]+name = "ashpd"+version = "0.13.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fb8421aaa9644a5faf26735f258b669b15f063313ef8f8e2bdb28912a1a6f111"+dependencies = [+ "enumflags2",+ "futures-util",+ "getrandom 0.4.3",+ "serde",+ "zbus",+]++[[package]]+name = "async-broadcast"+version = "0.7.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"+dependencies = [+ "event-listener",+ "event-listener-strategy",+ "futures-core",+ "pin-project-lite",+]++[[package]]+name = "async-channel"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"+dependencies = [+ "concurrent-queue",+ "event-listener-strategy",+ "futures-core",+ "pin-project-lite",+]++[[package]]+name = "async-executor"+version = "1.14.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f426a31126c735126297bc5ea7a521263c9faff4f63ca415267ee625651c4f37"+dependencies = [+ "async-task",+ "concurrent-queue",+ "fastrand",+ "futures-lite",+ "pin-project-lite",+ "slab",+]++[[package]]+name = "async-fs"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5"+dependencies = [+ "async-lock",+ "blocking",+ "futures-lite",+]++[[package]]+name = "async-io"+version = "2.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"+dependencies = [+ "autocfg",+ "cfg-if",+ "concurrent-queue",+ "futures-io",+ "futures-lite",+ "parking",+ "polling",+ "rustix",+ "slab",+ "windows-sys 0.61.2",+]++[[package]]+name = "async-lock"+version = "3.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0876700b0d007ad25d5508865a4259c3af9af6d296bf663a0d586d0bc3369f6f"+dependencies = [+ "event-listener",+ "event-listener-strategy",+ "pin-project-lite",+]++[[package]]+name = "async-net"+version = "2.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7"+dependencies = [+ "async-io",+ "blocking",+ "futures-lite",+]++[[package]]+name = "async-process"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"+dependencies = [+ "async-channel",+ "async-io",+ "async-lock",+ "async-signal",+ "async-task",+ "blocking",+ "cfg-if",+ "event-listener",+ "futures-lite",+ "rustix",+]++[[package]]+name = "async-recursion"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "async-signal"+version = "0.2.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"+dependencies = [+ "async-io",+ "async-lock",+ "atomic-waker",+ "cfg-if",+ "futures-core",+ "futures-io",+ "rustix",+ "signal-hook-registry",+ "slab",+ "windows-sys 0.61.2",+]++[[package]]+name = "async-task"+version = "4.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"++[[package]]+name = "async-trait"+version = "0.1.92"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "atomic"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba"++[[package]]+name = "atomic-waker"+version = "1.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"++[[package]]+name = "autocfg"+version = "1.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"++[[package]]+name = "av-scenechange"+version = "0.14.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394"+dependencies = [+ "aligned",+ "anyhow",+ "arg_enum_proc_macro",+ "arrayvec",+ "log",+ "num-rational",+ "num-traits",+ "pastey",+ "rayon",+ "thiserror 2.0.21",+ "v_frame",+ "y4m",+]++[[package]]+name = "av1-grain"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8"+dependencies = [+ "anyhow",+ "arrayvec",+ "log",+ "nom",+ "num-rational",+ "v_frame",+]++[[package]]+name = "avif-serialize"+version = "0.8.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e7178fe5f7d460b13895ebb9dcb28a3a6216d2df2574a0806cb51b555d297f38"+dependencies = [+ "arrayvec",+]++[[package]]+name = "backtrace"+version = "0.3.77"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "42f4220217f3288537b83684130f42fad43320b1c3b805f1910d683d52ded24f"+dependencies = [+ "addr2line",+ "cfg-if",+ "libc",+ "miniz_oxide 0.9.1",+ "object",+ "rustc-demangle",+ "windows-link 0.2.1",+]++[[package]]+name = "base62"+version = "2.2.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a3a647dce9631f152a99ec16cfc09267ae55fe280d5dc288964027d458076323"++[[package]]+name = "base64"+version = "0.22.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"++[[package]]+name = "base64"+version = "0.23.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"++[[package]]+name = "bit-set"+version = "0.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09ec2f926cc3060f09db9ebc5b52823d85268d24bb917e472c0c4bea35780a7d"+dependencies = [+ "bit-vec 0.9.1",+]++[[package]]+name = "bit-set"+version = "0.11.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "56d87354e4229f54a44f7bf2435906a4656dba36026ab6eaca629a2c436a691c"+dependencies = [+ "bit-vec 0.10.1",+]++[[package]]+name = "bit-vec"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51"++[[package]]+name = "bit-vec"+version = "0.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5727b15fa97d4f4fee0a3b7c3d550ed0269f54329207b86388de918604e31269"+dependencies = [+ "borsh",+ "serde",+]++[[package]]+name = "bit_field"+version = "0.10.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6"++[[package]]+name = "bitflags"+version = "1.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"++[[package]]+name = "bitflags"+version = "2.13.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"++[[package]]+name = "bitstream-io"+version = "4.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7eff00be299a18769011411c9def0d827e8f2d7bf0c3dbf53633147a8867fd1f"+dependencies = [+ "no_std_io2",+]++[[package]]+name = "blenderui-table"+version = "0.2.0"++[[package]]+name = "blenderui-table-gpui"+version = "0.2.0"+dependencies = [+ "blenderui-table",+ "gpui-component",+ "gpui-kit-assets",+ "gpui-pre",+ "gpui-pre-platform",+]++[[package]]+name = "block"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"++[[package]]+name = "block-buffer"+version = "0.10.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"+dependencies = [+ "generic-array",+]++[[package]]+name = "block-buffer"+version = "0.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"+dependencies = [+ "hybrid-array",+]++[[package]]+name = "block-padding"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"+dependencies = [+ "generic-array",+]++[[package]]+name = "block2"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f"+dependencies = [+ "objc2 0.5.3",+]++[[package]]+name = "block2"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"+dependencies = [+ "objc2 0.6.5",+]++[[package]]+name = "blocking"+version = "1.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa"+dependencies = [+ "async-channel",+ "async-task",+ "futures-io",+ "futures-lite",+ "piper",+]++[[package]]+name = "borsh"+version = "1.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "553c5d846a6ba5150c65e3b1b8ec073bcf1abc20f9b7220de384a4443ea4e20a"+dependencies = [+ "borsh-derive",+ "bytes",+ "cfg_aliases",+]++[[package]]+name = "borsh-derive"+version = "1.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "12cdfe656708a01f89b451a7d36466e6fe6c414de0aa18fc54f864f6f9ca9f56"+dependencies = [+ "once_cell",+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "bstr"+version = "1.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f"+dependencies = [+ "memchr",+ "regex-automata",+ "serde_core",+]++[[package]]+name = "built"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9"++[[package]]+name = "bumpalo"+version = "3.20.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"++[[package]]+name = "bytemuck"+version = "1.25.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"+dependencies = [+ "bytemuck_derive",+]++[[package]]+name = "bytemuck_derive"+version = "1.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6a1f896587b6f2c069c73d2f0913e2d590c3990285cd2f0b6aa02b786b4c679c"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "byteorder"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"++[[package]]+name = "byteorder-lite"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"++[[package]]+name = "bytes"+version = "1.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"++[[package]]+name = "c-enum"+version = "0.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cd17eb909a8c6a894926bfcc3400a4bb0e732f5a57d37b1f14e8b29e329bace8"++[[package]]+name = "calloop"+version = "0.14.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "43b32313e937c8721c9d17ee9bf60699a6402b4b7c2cb6ac1bee0ffcaa4b4e5e"+dependencies = [+ "bitflags 2.13.2",+ "polling",+ "rustix",+ "tracing",+]++[[package]]+name = "cast"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"++[[package]]+name = "cbc"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6"+dependencies = [+ "cipher",+]++[[package]]+name = "cbindgen"+version = "0.28.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eadd868a2ce9ca38de7eeafdcec9c7065ef89b42b32f0839278d55f35c54d1ff"+dependencies = [+ "heck 0.4.1",+ "indexmap",+ "log",+ "proc-macro2",+ "quote",+ "serde",+ "serde_json",+ "syn 2.0.119",+ "tempfile",+ "toml 0.8.23",+]++[[package]]+name = "cc"+version = "1.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "375989decec1a0fa424442bed520fa12ede43a48475ce8c7417d2c69b32b5f6b"+dependencies = [+ "find-msvc-tools",+ "jobserver",+ "libc",+ "shlex",+]++[[package]]+name = "cfg-if"+version = "1.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"++[[package]]+name = "cfg_aliases"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"++[[package]]+name = "chacha20"+version = "0.10.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06"+dependencies = [+ "cfg-if",+ "cpufeatures 0.3.1",+ "rand_core 0.10.1",+]++[[package]]+name = "chrono"+version = "0.4.45"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327"+dependencies = [+ "iana-time-zone",+ "js-sys",+ "num-traits",+ "serde",+ "wasm-bindgen",+ "windows-link 0.2.1",+]++[[package]]+name = "ciborium"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e"+dependencies = [+ "ciborium-io",+ "ciborium-ll",+ "serde",+]++[[package]]+name = "ciborium-io"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757"++[[package]]+name = "ciborium-ll"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"+dependencies = [+ "ciborium-io",+ "half",+]++[[package]]+name = "cipher"+version = "0.4.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"+dependencies = [+ "crypto-common 0.1.7",+ "inout",+ "zeroize",+]++[[package]]+name = "clap"+version = "4.6.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946"+dependencies = [+ "clap_builder",+]++[[package]]+name = "clap_builder"+version = "4.6.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d"+dependencies = [+ "anstyle",+ "clap_lex",+]++[[package]]+name = "clap_lex"+version = "1.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486"++[[package]]+name = "cocoa"+version = "0.25.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c"+dependencies = [+ "bitflags 1.3.2",+ "block",+ "cocoa-foundation",+ "core-foundation 0.9.4",+ "core-graphics 0.23.2",+ "foreign-types",+ "libc",+ "objc",+]++[[package]]+name = "cocoa-foundation"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7"+dependencies = [+ "bitflags 1.3.2",+ "block",+ "core-foundation 0.9.4",+ "core-graphics-types 0.1.3",+ "libc",+ "objc",+]++[[package]]+name = "codespan-reporting"+version = "0.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681"+dependencies = [+ "serde",+ "termcolor",+ "unicode-width",+]++[[package]]+name = "color_quant"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"++[[package]]+name = "concurrent-queue"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"+dependencies = [+ "crossbeam-utils",+]++[[package]]+name = "console_error_panic_hook"+version = "0.1.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"+dependencies = [+ "cfg-if",+ "wasm-bindgen",+]++[[package]]+name = "const-oid"+version = "0.10.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c"++[[package]]+name = "convert_case"+version = "0.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9"+dependencies = [+ "unicode-segmentation",+]++[[package]]+name = "convert_case"+version = "0.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "affbf0190ed2caf063e3def54ff444b449371d55c58e513a95ab98eca50adb49"+dependencies = [+ "unicode-segmentation",+]++[[package]]+name = "core-foundation"+version = "0.9.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"+dependencies = [+ "core-foundation-sys",+ "libc",+]++[[package]]+name = "core-foundation"+version = "0.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"+dependencies = [+ "core-foundation-sys",+ "libc",+]++[[package]]+name = "core-foundation-sys"+version = "0.8.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"++[[package]]+name = "core-graphics"+version = "0.23.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081"+dependencies = [+ "bitflags 1.3.2",+ "core-foundation 0.9.4",+ "core-graphics-types 0.1.3",+ "foreign-types",+ "libc",+]++[[package]]+name = "core-graphics"+version = "0.24.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1"+dependencies = [+ "bitflags 2.13.2",+ "core-foundation 0.10.1",+ "core-graphics-types 0.2.0",+ "foreign-types",+ "libc",+]++[[package]]+name = "core-graphics-helmer-fork"+version = "0.24.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32eb7c354ae9f6d437a6039099ce7ecd049337a8109b23d73e48e8ffba8e9cd5"+dependencies = [+ "bitflags 2.13.2",+ "core-foundation 0.9.4",+ "core-graphics-types 0.1.3",+ "foreign-types",+ "libc",+]++[[package]]+name = "core-graphics-types"+version = "0.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf"+dependencies = [+ "bitflags 1.3.2",+ "core-foundation 0.9.4",+ "libc",+]++[[package]]+name = "core-graphics-types"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"+dependencies = [+ "bitflags 2.13.2",+ "core-foundation 0.10.1",+ "libc",+]++[[package]]+name = "core-text"+version = "21.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a593227b66cbd4007b2a050dfdd9e1d1318311409c8d600dc82ba1b15ca9c130"+dependencies = [+ "core-foundation 0.10.1",+ "core-graphics 0.24.0",+ "foreign-types",+ "libc",+]++[[package]]+name = "core_detect"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48"++[[package]]+name = "core_maths"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30"+dependencies = [+ "libm",+]++[[package]]+name = "cosmic-text"+version = "0.19.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "be17b688510d934ce13f48a2beba700e11583e281e0fda99c22bb256a14eda73"+dependencies = [+ "bitflags 2.13.2",+ "fontdb",+ "harfrust",+ "linebender_resource_handle",+ "log",+ "rangemap",+ "rustc-hash 2.1.3",+ "self_cell",+ "skrifa 0.40.0",+ "smol_str",+ "swash",+ "sys-locale",+ "unicode-bidi",+ "unicode-linebreak",+ "unicode-script",+ "unicode-segmentation",+]++[[package]]+name = "cpufeatures"+version = "0.2.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"+dependencies = [+ "libc",+]++[[package]]+name = "cpufeatures"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"+dependencies = [+ "libc",+]++[[package]]+name = "crc32fast"+version = "1.5.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5f97d3416d5337d15c4b0d78c8c91df922ca143f57ec20e2d1c188333047ef04"+dependencies = [+ "cfg-if",+]++[[package]]+name = "criterion"+version = "0.8.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3"+dependencies = [+ "alloca",+ "anes",+ "cast",+ "ciborium",+ "clap",+ "criterion-plot",+ "itertools 0.13.0",+ "num-traits",+ "oorandom",+ "page_size",+ "plotters",+ "rayon",+ "regex",+ "serde",+ "serde_json",+ "tinytemplate",+ "walkdir",+]++[[package]]+name = "criterion-plot"+version = "0.8.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea"+dependencies = [+ "cast",+ "itertools 0.13.0",+]++[[package]]+name = "crossbeam-deque"+version = "0.8.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"+dependencies = [+ "crossbeam-epoch",+ "crossbeam-utils",+]++[[package]]+name = "crossbeam-epoch"+version = "0.9.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"+dependencies = [+ "crossbeam-utils",+]++[[package]]+name = "crossbeam-queue"+version = "0.3.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "03e8bd762f7479489c70ed6c768ddca99d7296857de437a68dcb2a94365b3fae"+dependencies = [+ "crossbeam-utils",+]++[[package]]+name = "crossbeam-utils"+version = "0.8.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"++[[package]]+name = "crunchy"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"++[[package]]+name = "crypto-common"+version = "0.1.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"+dependencies = [+ "generic-array",+ "typenum",+]++[[package]]+name = "crypto-common"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"+dependencies = [+ "hybrid-array",+]++[[package]]+name = "ctor"+version = "1.0.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d"+dependencies = [+ "link-section",+ "linktime-proc-macro",+]++[[package]]+name = "data-url"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376"++[[package]]+name = "deranged"+version = "0.5.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e"++[[package]]+name = "derive_more"+version = "2.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134"+dependencies = [+ "derive_more-impl",+]++[[package]]+name = "derive_more-impl"+version = "2.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb"+dependencies = [+ "convert_case 0.10.0",+ "proc-macro2",+ "quote",+ "rustc_version",+ "syn 2.0.119",+]++[[package]]+name = "digest"+version = "0.10.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"+dependencies = [+ "block-buffer 0.10.4",+ "crypto-common 0.1.7",+ "subtle",+]++[[package]]+name = "digest"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"+dependencies = [+ "block-buffer 0.12.1",+ "const-oid",+ "crypto-common 0.2.2",+]++[[package]]+name = "dirs"+version = "5.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225"+dependencies = [+ "dirs-sys 0.4.1",+]++[[package]]+name = "dirs"+version = "6.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e"+dependencies = [+ "dirs-sys 0.5.0",+]++[[package]]+name = "dirs-sys"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c"+dependencies = [+ "libc",+ "option-ext",+ "redox_users 0.4.6",+ "windows-sys 0.48.0",+]++[[package]]+name = "dirs-sys"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"+dependencies = [+ "libc",+ "option-ext",+ "redox_users 0.5.3",+ "windows-sys 0.61.2",+]++[[package]]+name = "dispatch"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b"++[[package]]+name = "dispatch2"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "objc2 0.6.5",+]++[[package]]+name = "displaydoc"+version = "0.2.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "dlib"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a"+dependencies = [+ "libloading",+]++[[package]]+name = "document-features"+version = "0.2.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61"+dependencies = [+ "litrs",+]++[[package]]+name = "dunce"+version = "1.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"++[[package]]+name = "dwrote"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e1b35532432acc8b19ceed096e35dfa088d3ea037fe4f3c085f1f97f33b4d02"+dependencies = [+ "lazy_static",+ "libc",+ "winapi",+ "wio",+]++[[package]]+name = "dyn-clone"+version = "1.0.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"++[[package]]+name = "either"+version = "1.19.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"++[[package]]+name = "embed-resource"+version = "3.0.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6168487b5e7eb2673e6efe1200b1848016e436a6ca0b8031bf04bd9d493a249f"+dependencies = [+ "cc",+ "memchr",+ "rustc_version",+ "toml 1.2.0+spec-1.1.0",+ "vswhom",+ "winreg",+]++[[package]]+name = "encoding_rs"+version = "0.8.44"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5"+dependencies = [+ "cfg-if",+ "core_detect",+ "multiversion_no_op",+ "rustversion",+ "scopeguard",+ "simdutf8",+]++[[package]]+name = "encoding_rs_io"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fba3fe847045ecff794b9c138293a80db914678c453ad63fbf0c6a9eb6e00b22"+dependencies = [+ "encoding_rs",+]++[[package]]+name = "endi"+version = "1.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"++[[package]]+name = "enum-iterator"+version = "2.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a4549325971814bda7a44061bf3fe7e487d447cba01e4220a4b454d630d7a016"+dependencies = [+ "enum-iterator-derive",+]++[[package]]+name = "enum-iterator-derive"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "685adfa4d6f3d765a26bc5dbc936577de9abf756c1feeb3089b01dd395034842"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "enumflags2"+version = "0.7.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"+dependencies = [+ "enumflags2_derive",+ "serde",+]++[[package]]+name = "enumflags2_derive"+version = "0.7.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "enumn"+version = "0.1.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "equator"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc"+dependencies = [+ "equator-macro",+]++[[package]]+name = "equator-macro"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "equivalent"+version = "1.0.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"++[[package]]+name = "errno"+version = "0.3.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"+dependencies = [+ "libc",+ "windows-sys 0.61.2",+]++[[package]]+name = "etagere"+version = "0.2.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fc89bf99e5dc15954a60f707c1e09d7540e5cd9af85fa75caa0b510bc08c5342"+dependencies = [+ "euclid",+ "svg_fmt",+]++[[package]]+name = "euclid"+version = "0.22.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06"+dependencies = [+ "num-traits",+]++[[package]]+name = "event-listener"+version = "5.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"+dependencies = [+ "parking",+ "pin-project-lite",+]++[[package]]+name = "event-listener-strategy"+version = "0.5.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"+dependencies = [+ "event-listener",+ "pin-project-lite",+]++[[package]]+name = "exr"+version = "1.74.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "711fe42c9964295e01ee3fba3f9fe0e1d24b98886950d68efe81b1c76e21adf3"+dependencies = [+ "bit_field",+ "half",+ "lebe",+ "miniz_oxide 0.8.9",+ "num-complex",+ "pulp",+ "rayon-core",+ "smallvec",+ "zune-inflate",+]++[[package]]+name = "fastrand"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"++[[package]]+name = "fax"+version = "0.2.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a"++[[package]]+name = "fdeflate"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c"+dependencies = [+ "simd-adler32",+]++[[package]]+name = "find-msvc-tools"+version = "0.1.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48"++[[package]]+name = "fixedbitset"+version = "0.5.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99"++[[package]]+name = "flate2"+version = "1.1.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb"+dependencies = [+ "crc32fast",+ "miniz_oxide 0.9.1",+ "zlib-rs",+]++[[package]]+name = "float-cmp"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"++[[package]]+name = "float-ord"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8ce81f49ae8a0482e4c55ea62ebbd7e5a686af544c00b9d090bba3ff9be97b3d"++[[package]]+name = "float_next_after"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8"++[[package]]+name = "fluent-uri"+version = "0.1.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d"+dependencies = [+ "bitflags 1.3.2",+]++[[package]]+name = "flume"+version = "0.12.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5e139bc46ca777eb5efaf62df0ab8cc5fd400866427e56c68b22e414e53bd3be"+dependencies = [+ "futures-core",+ "futures-sink",+ "spin 0.9.9",+]++[[package]]+name = "fnv"+version = "1.0.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"++[[package]]+name = "foldhash"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"++[[package]]+name = "font-types"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5b38ad915f6dadd993ced50848a8291a543bd41ca62bc10740d5e64e2ab4cfd7"+dependencies = [+ "bytemuck",+]++[[package]]+name = "font-types"+version = "0.12.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "835ae9d781464a79026cde387f9cbc650c9a4909d7cf7e658b127e3c35d2f35d"+dependencies = [+ "bytemuck",+]++[[package]]+name = "fontconfig-parser"+version = "0.5.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbc773e24e02d4ddd8395fd30dc147524273a83e54e0f312d986ea30de5f5646"+dependencies = [+ "roxmltree 0.20.0",+]++[[package]]+name = "fontdb"+version = "0.23.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905"+dependencies = [+ "fontconfig-parser",+ "log",+ "memmap2",+ "slotmap",+ "tinyvec",+ "ttf-parser",+]++[[package]]+name = "foreign-types"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"+dependencies = [+ "foreign-types-macros",+ "foreign-types-shared",+]++[[package]]+name = "foreign-types-macros"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "foreign-types-shared"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"++[[package]]+name = "form_urlencoded"+version = "1.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"+dependencies = [+ "percent-encoding",+]++[[package]]+name = "freetype-sys"+version = "0.20.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0e7edc5b9669349acfda99533e9e0bcf26a51862ab43b08ee7745c55d28eb134"+dependencies = [+ "cc",+ "libc",+ "pkg-config",+]++[[package]]+name = "futf"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843"+dependencies = [+ "mac",+ "new_debug_unreachable",+]++[[package]]+name = "futures"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"+dependencies = [+ "futures-channel",+ "futures-core",+ "futures-executor",+ "futures-io",+ "futures-sink",+ "futures-task",+ "futures-util",+]++[[package]]+name = "futures-channel"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"+dependencies = [+ "futures-core",+ "futures-sink",+]++[[package]]+name = "futures-concurrency"+version = "7.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "175cd8cca9e1d45b87f18ffa75088f2099e3c4fe5e2f83e42de112560bea8ea6"+dependencies = [+ "fixedbitset",+ "futures-core",+ "futures-lite",+ "pin-project",+ "smallvec",+]++[[package]]+name = "futures-core"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"++[[package]]+name = "futures-executor"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"+dependencies = [+ "futures-core",+ "futures-task",+ "futures-util",+]++[[package]]+name = "futures-io"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"++[[package]]+name = "futures-lite"+version = "2.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"+dependencies = [+ "fastrand",+ "futures-core",+ "futures-io",+ "parking",+ "pin-project-lite",+]++[[package]]+name = "futures-macro"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "futures-sink"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"++[[package]]+name = "futures-task"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"++[[package]]+name = "futures-util"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"+dependencies = [+ "futures-channel",+ "futures-core",+ "futures-io",+ "futures-macro",+ "futures-sink",+ "futures-task",+ "memchr",+ "pin-project-lite",+ "slab",+]++[[package]]+name = "generic-array"+version = "0.14.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"+dependencies = [+ "typenum",+ "version_check",+]++[[package]]+name = "getrandom"+version = "0.2.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"+dependencies = [+ "cfg-if",+ "js-sys",+ "libc",+ "wasi",+ "wasm-bindgen",+]++[[package]]+name = "getrandom"+version = "0.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"+dependencies = [+ "cfg-if",+ "js-sys",+ "libc",+ "r-efi 5.3.0",+ "wasip2",+ "wasm-bindgen",+]++[[package]]+name = "getrandom"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"+dependencies = [+ "cfg-if",+ "js-sys",+ "libc",+ "r-efi 6.0.0",+ "rand_core 0.10.1",+ "wasm-bindgen",+]++[[package]]+name = "gif"+version = "0.13.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b"+dependencies = [+ "color_quant",+ "weezl",+]++[[package]]+name = "gif"+version = "0.14.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159"+dependencies = [+ "color_quant",+ "weezl",+]++[[package]]+name = "gimli"+version = "0.34.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1033caf0b349c518623b5396bfb2cf0bddf44f0306d543a250e5743297aafd10"++[[package]]+name = "gl_generator"+version = "0.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d"+dependencies = [+ "khronos_api",+ "log",+ "xml-rs",+]++[[package]]+name = "glob"+version = "0.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"++[[package]]+name = "globset"+version = "0.4.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f98b0d85522dc0a824cfebbc9594ff4a9b289c568bea0370319dfbdf20ccdd2d"+dependencies = [+ "aho-corasick",+ "bstr",+ "log",+ "regex-automata",+ "regex-syntax",+]++[[package]]+name = "globwalk"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc"+dependencies = [+ "bitflags 1.3.2",+ "ignore",+ "walkdir",+]++[[package]]+name = "glow"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29038e1c483364cc6bb3cf78feee1816002e127c331a1eec55a4d202b9e1adb5"+dependencies = [+ "js-sys",+ "slotmap",+ "wasm-bindgen",+ "web-sys",+]++[[package]]+name = "glutin_wgl_sys"+version = "0.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e"+dependencies = [+ "gl_generator",+]++[[package]]+name = "gpu-allocator"+version = "0.28.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795"+dependencies = [+ "ash",+ "hashbrown 0.16.1",+ "log",+ "presser",+ "thiserror 2.0.21",+ "windows 0.62.2",+]++[[package]]+name = "gpui-base"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cff6377e30f0c857681662e7edc7286bf30f5606033390401b0706d7bd930833"+dependencies = [+ "aho-corasick",+ "anyhow",+ "ashpd",+ "async-channel",+ "chrono",+ "data-url",+ "futures",+ "gpui-pre",+ "gpui-pre-macros",+ "gpui-pre-sum-tree",+ "html5ever",+ "instant",+ "itertools 0.13.0",+ "lsp-types",+ "markdown",+ "markup5ever_rcdom",+ "num-traits",+ "objc2 0.6.5",+ "objc2-app-kit 0.3.2",+ "objc2-foundation 0.3.2",+ "raw-window-handle",+ "regex",+ "ropey",+ "schemars",+ "serde",+ "serde_json",+ "smallvec",+ "smol",+ "tracing",+ "unicode-linebreak",+ "unicode-segmentation",+ "web-time",+ "windows 0.58.0",+]++[[package]]+name = "gpui-component"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "45bbfdba0efa392190f2fd446ec311325302eb047d5ce45dc1bcf189cb18f5eb"+dependencies = [+ "anyhow",+ "chrono",+ "core-text",+ "enum-iterator",+ "gpui-base",+ "gpui-component-macros",+ "gpui-kit-assets",+ "gpui-pre",+ "gpui-pre-macros",+ "gpui-pre-sum-tree",+ "instant",+ "itertools 0.13.0",+ "log",+ "lsp-types",+ "markdown",+ "notify",+ "num-traits",+ "objc2 0.6.5",+ "objc2-app-kit 0.3.2",+ "objc2-foundation 0.3.2",+ "once_cell",+ "paste",+ "raw-window-handle",+ "regex",+ "resvg 0.45.1",+ "ropey",+ "rust-i18n",+ "schemars",+ "serde",+ "serde_json",+ "serde_repr",+ "similar",+ "smallvec",+ "smol",+ "tracing",+ "unicode-segmentation",+ "unicode-width",+ "uuid",+ "windows 0.58.0",+]++[[package]]+name = "gpui-component-macros"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "21ac1d2ca5352973e291b3316c027e603b1e7334755341f44c8231f85fde627a"+dependencies = [+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "gpui-kit-assets"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "956a9864880e1f230e274a74cea8006e5018b8af383ad7bbd30b6b18254a97a9"+dependencies = [+ "anyhow",+ "gpui-pre",+ "gpui-pre-reqwest",+ "log",+ "rust-embed",+ "wasm-bindgen",+ "wasm-bindgen-futures",+]++[[package]]+name = "gpui-pre"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9303c771abf2acff2a96d706f69d9a82088c4770173a07cce88f0002431d887d"+dependencies = [+ "accesskit",+ "anyhow",+ "async-channel",+ "async-task",+ "backtrace",+ "bitflags 2.13.2",+ "chrono",+ "derive_more",+ "embed-resource",+ "etagere",+ "futures",+ "futures-concurrency",+ "getrandom 0.3.4",+ "gpui-pre-bench-metrics",+ "gpui-pre-collections",+ "gpui-pre-http-client",+ "gpui-pre-macros",+ "gpui-pre-refineable",+ "gpui-pre-scheduler",+ "gpui-pre-shared-string",+ "gpui-pre-sum-tree",+ "gpui-pre-util",+ "heapless",+ "icu_segmenter",+ "image",+ "inventory",+ "itertools 0.14.0",+ "libc",+ "log",+ "lyon",+ "num_cpus",+ "objc2-core-foundation",+ "objc2-core-video",+ "parking",+ "parking_lot",+ "pin-project",+ "pollster 0.4.0",+ "postage",+ "profiling",+ "proptest",+ "rand 0.9.5",+ "raw-window-handle",+ "regex",+ "resvg 0.46.0",+ "schemars",+ "seahash",+ "serde",+ "serde_json",+ "slotmap",+ "smallvec",+ "spin 0.10.1",+ "strum",+ "taffy",+ "thiserror 2.0.21",+ "ttf-parser",+ "unicode-segmentation",+ "url",+ "usvg 0.46.0",+ "uuid",+ "waker-fn",+ "web-time",+ "windows 0.62.2",+ "zed-scap",+]++[[package]]+name = "gpui-pre-apple"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8c0bea8ffa563d3a1ada533e148bb55be7fb873c178979e889a3d1204f8e1b91"+dependencies = [+ "anyhow",+ "async-task",+ "block2 0.6.2",+ "cbindgen",+ "core-foundation 0.10.1",+ "core-foundation-sys",+ "core-graphics 0.24.0",+ "core-text",+ "dispatch2",+ "etagere",+ "futures",+ "gpui-pre",+ "gpui-pre-collections",+ "gpui-pre-util",+ "image",+ "libc",+ "log",+ "mach2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-core-graphics",+ "objc2-core-text",+ "objc2-core-video",+ "objc2-foundation 0.3.2",+ "objc2-metal 0.3.2",+ "objc2-quartz-core 0.3.2",+ "objc2-security",+ "parking_lot",+ "pathfinder_geometry",+ "smallvec",+ "thiserror 2.0.21",+ "zed-font-kit",+]++[[package]]+name = "gpui-pre-bench-metrics"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a2380f9a4c76fbbf035fe0b83e7054216e0dbacb18e2a95bb26c27bda22376e3"+dependencies = [+ "anyhow",+ "criterion",+ "libc",+ "perf-event2",+]++[[package]]+name = "gpui-pre-collections"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "06882d54d40681ae3b145af9ef8a4021c2bf9967cc0a9fcf0cc50f003bf3cdf3"+dependencies = [+ "gpui-pre-util",+ "indexmap",+ "rustc-hash 2.1.3",+]++[[package]]+name = "gpui-pre-derive-refineable"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3999591b50cfd74f1734baf97fe802cce5f282d60d85b908e3393d534fbd50fb"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "gpui-pre-http-client"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a00ff0e68341f52c5903182d7e2e2d7dc247d87b0d9947ce3564e453720347a0"+dependencies = [+ "anyhow",+ "bytes",+ "futures",+ "http",+ "http-body",+ "log",+ "parking_lot",+ "serde",+ "serde_json",+ "serde_urlencoded",+ "url",+]++[[package]]+name = "gpui-pre-ios"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "326382c3b3f004617ac0f61338594c00f053b08b7875f3486ea0f221e9b20a75"+dependencies = [+ "anyhow",+ "block2 0.6.2",+ "futures",+ "gpui-pre",+ "gpui-pre-apple",+ "log",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-foundation 0.3.2",+ "objc2-quartz-core 0.3.2",+ "objc2-ui-kit",+ "parking_lot",+ "raw-window-handle",+ "uuid",+]++[[package]]+name = "gpui-pre-linux"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "79cac5cbd3485c1e3db8eafd5dc69019188f5cb0a39846946af772efa386f624"+dependencies = [+ "accesskit",+ "anyhow",+ "bytemuck",+ "calloop",+ "futures",+ "gpui-pre",+ "gpui-pre-collections",+ "gpui-pre-http-client",+ "gpui-pre-util",+ "libc",+ "log",+ "notify-rust",+ "oo7",+ "parking_lot",+ "raw-window-handle",+ "smallvec",+ "smol",+ "strum",+ "url",+ "uuid",+]++[[package]]+name = "gpui-pre-macos"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d7410cfdaa1fa55a414346cc492d18ce340e3a8b6d0ac3213b984ed690c82b92"+dependencies = [+ "accesskit",+ "accesskit_macos",+ "anyhow",+ "block2 0.6.2",+ "core-foundation 0.10.1",+ "core-foundation-sys",+ "core-graphics 0.24.0",+ "ctor",+ "dispatch2",+ "foreign-types",+ "futures",+ "gpui-pre",+ "gpui-pre-apple",+ "gpui-pre-collections",+ "gpui-pre-scheduler",+ "gpui-pre-util",+ "image",+ "itertools 0.14.0",+ "log",+ "objc2 0.6.5",+ "objc2-app-kit 0.3.2",+ "objc2-core-graphics",+ "objc2-core-video",+ "objc2-foundation 0.3.2",+ "objc2-quartz-core 0.3.2",+ "objc2-uniform-type-identifiers",+ "objc2-user-notifications",+ "parking_lot",+ "raw-window-handle",+ "semver",+ "smallvec",+ "strum",+ "uuid",+]++[[package]]+name = "gpui-pre-macros"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ee1c52959baa6834db3183e86affe70242ca90b4fc64ed2ae6dd689a799ce78e"+dependencies = [+ "heck 0.5.0",+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "gpui-pre-platform"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "175f55bd6a80ea3bb0cf44d9ba454a3312381d66e702b3b5e99f73a7ca1738ee"+dependencies = [+ "anyhow",+ "console_error_panic_hook",+ "gpui-pre",+ "gpui-pre-ios",+ "gpui-pre-linux",+ "gpui-pre-macos",+ "gpui-pre-web",+ "gpui-pre-windows",+]++[[package]]+name = "gpui-pre-refineable"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "097375d98fecafd6e00ec13c7711709cc6d827ccad385694ce9e2c2f570c02a5"+dependencies = [+ "gpui-pre-derive-refineable",+]++[[package]]+name = "gpui-pre-reqwest"+version = "0.12.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "05be23908e707966824f8c51a609904b7f30739e8d915e120a53c1b995ba964c"+dependencies = [+ "base64 0.22.1",+ "bytes",+ "encoding_rs",+ "futures-core",+ "futures-util",+ "h2",+ "http",+ "http-body",+ "http-body-util",+ "hyper",+ "hyper-rustls",+ "hyper-util",+ "ipnet",+ "js-sys",+ "log",+ "mime",+ "mime_guess",+ "once_cell",+ "percent-encoding",+ "pin-project-lite",+ "quinn",+ "rustls",+ "rustls-native-certs",+ "rustls-pemfile",+ "rustls-pki-types",+ "serde",+ "serde_json",+ "serde_urlencoded",+ "sync_wrapper",+ "system-configuration",+ "tokio",+ "tokio-rustls",+ "tokio-socks",+ "tokio-util",+ "tower",+ "tower-service",+ "url",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "wasm-streams",+ "web-sys",+ "windows-registry 0.4.0",+]++[[package]]+name = "gpui-pre-scheduler"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "93c3c9f76341cdf03801699d68876915b42d5858e80c52a141ebfc350358147b"+dependencies = [+ "async-task",+ "backtrace",+ "chrono",+ "flume",+ "futures",+ "parking_lot",+ "rand 0.9.5",+ "wasm_thread",+ "web-time",+]++[[package]]+name = "gpui-pre-shared-string"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "781aaf9a9c19e3367b94100c7b1a17283721766bc890909ce8aa34e8c5b1a99a"+dependencies = [+ "schemars",+ "serde",+ "smol_str",+]++[[package]]+name = "gpui-pre-sum-tree"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e0cb18765472fb2c64b7e6374f9a36f512ce25b1ccb3662fff51788564107eb3"+dependencies = [+ "gpui-pre-ztracing",+ "heapless",+ "rayon",+ "tracing",+]++[[package]]+name = "gpui-pre-util"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "49036ad9887034f8d6652b65761ee1c1fdbd7d66be33a6088245fae54dc643e3"+dependencies = [+ "anyhow",+ "log",+ "which",+]++[[package]]+name = "gpui-pre-web"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ad51fcf6e251d45b092fd4a98a26325eb9cf6ad4e6228b0c6bc50672db9e0563"+dependencies = [+ "anyhow",+ "async-channel",+ "console_error_panic_hook",+ "futures",+ "gpui-pre",+ "gpui-pre-http-client",+ "gpui-pre-scheduler",+ "gpui-pre-wgpu",+ "js-sys",+ "log",+ "parking_lot",+ "raw-window-handle",+ "smallvec",+ "unicode-properties",+ "unicode-script",+ "unicode-segmentation",+ "uuid",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "wasm_thread",+ "web-sys",+ "web-time",+]++[[package]]+name = "gpui-pre-wgpu"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "211cf352de1a0b0c9bea3f105df5572ce1d2c899389b924a888e5af36b50f93d"+dependencies = [+ "anyhow",+ "bytemuck",+ "cosmic-text",+ "etagere",+ "gpui-pre",+ "gpui-pre-collections",+ "gpui-pre-util",+ "itertools 0.14.0",+ "log",+ "parking_lot",+ "profiling",+ "raw-window-handle",+ "smallvec",+ "swash",+ "unicode-bidi",+ "unicode-segmentation",+ "web-sys",+ "wgpu",+]++[[package]]+name = "gpui-pre-windows"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5141a3db59bab761a16ab19529fe4117a86e91922e8fc00af6dfc4829cb1744d"+dependencies = [+ "accesskit",+ "accesskit_windows",+ "anyhow",+ "dunce",+ "etagere",+ "futures",+ "gpui-pre",+ "gpui-pre-collections",+ "gpui-pre-scheduler",+ "gpui-pre-util",+ "image",+ "itertools 0.14.0",+ "log",+ "parking_lot",+ "rand 0.9.5",+ "raw-window-handle",+ "smallvec",+ "uuid",+ "windows 0.62.2",+ "windows-core 0.62.2",+ "windows-numerics 0.3.1",+ "windows-registry 0.6.1",+]++[[package]]+name = "gpui-pre-ztracing"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7ac9274f4fb36ce6bf128f9b48032196a3120cb858503af33ced6c21366cf2f7"+dependencies = [+ "gpui-pre-ztracing-macro",+ "tracing",+]++[[package]]+name = "gpui-pre-ztracing-macro"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "99b18b06f5026b3d312488eacfdddbe78f82b4bf32bb2d2bc3186e31e552b797"++[[package]]+name = "granit-parser"+version = "1.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e20f99e46474f56bd905c56e817ebddcf377a611f94c53ac4649e4d3fa3c0cd0"+dependencies = [+ "arraydeque",+ "smallvec",+]++[[package]]+name = "h2"+version = "0.4.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7d29020232d6aa3fb1daca64c1127cf662cf97f254ae16c18c05b8ab635fc118"+dependencies = [+ "atomic-waker",+ "bytes",+ "fnv",+ "futures-core",+ "futures-sink",+ "http",+ "indexmap",+ "slab",+ "tokio",+ "tokio-util",+ "tracing",+]++[[package]]+name = "half"+version = "2.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"+dependencies = [+ "cfg-if",+ "crunchy",+ "num-traits",+ "zerocopy",+]++[[package]]+name = "harfrust"+version = "0.5.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9da2e5ae821f6e96664977bf974d6d6a2d6682f9ccee23e62ec1d134246845f9"+dependencies = [+ "bitflags 2.13.2",+ "bytemuck",+ "core_maths",+ "read-fonts 0.37.0",+ "smallvec",+]++[[package]]+name = "hash32"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"+dependencies = [+ "byteorder",+]++[[package]]+name = "hashbrown"+version = "0.16.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"+dependencies = [+ "allocator-api2",+ "equivalent",+ "foldhash",+]++[[package]]+name = "hashbrown"+version = "0.17.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"+dependencies = [+ "foldhash",+]++[[package]]+name = "heapless"+version = "0.9.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "25ba4bd83f9415b58b4ed8dc5714c76e626a105be4646c02630ad730ad3b5aa4"+dependencies = [+ "hash32",+ "stable_deref_trait",+]++[[package]]+name = "heck"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"++[[package]]+name = "heck"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"++[[package]]+name = "hermit-abi"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284"++[[package]]+name = "hex"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"++[[package]]+name = "hkdf"+version = "0.12.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"+dependencies = [+ "hmac",+]++[[package]]+name = "hmac"+version = "0.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"+dependencies = [+ "digest 0.10.7",+]++[[package]]+name = "html5ever"+version = "0.27.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4"+dependencies = [+ "log",+ "mac",+ "markup5ever",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "http"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0"+dependencies = [+ "bytes",+ "itoa",+]++[[package]]+name = "http-body"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c"+dependencies = [+ "bytes",+ "http",+]++[[package]]+name = "http-body-util"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c"+dependencies = [+ "bytes",+ "futures-core",+ "http",+ "http-body",+ "pin-project-lite",+]++[[package]]+name = "httparse"+version = "1.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"++[[package]]+name = "hybrid-array"+version = "0.4.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17"+dependencies = [+ "typenum",+]++[[package]]+name = "hyper"+version = "1.12.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2c3e324da4c95177d6291d4c8730197c0d1822f8a9766814a4a44fa5ab797c9c"+dependencies = [+ "atomic-waker",+ "bytes",+ "futures-channel",+ "futures-core",+ "h2",+ "http",+ "http-body",+ "httparse",+ "itoa",+ "pin-project-lite",+ "smallvec",+ "tokio",+ "want",+]++[[package]]+name = "hyper-rustls"+version = "0.27.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53"+dependencies = [+ "http",+ "hyper",+ "hyper-util",+ "rustls",+ "rustls-native-certs",+ "tokio",+ "tokio-rustls",+ "tower-service",+]++[[package]]+name = "hyper-util"+version = "0.1.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff"+dependencies = [+ "bytes",+ "futures-channel",+ "futures-util",+ "http",+ "http-body",+ "httparse",+ "hyper",+ "libc",+ "pin-project-lite",+ "socket2",+ "tokio",+ "tower-service",+ "tracing",+]++[[package]]+name = "iana-time-zone"+version = "0.1.65"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"+dependencies = [+ "android_system_properties",+ "core-foundation-sys",+ "iana-time-zone-haiku",+ "js-sys",+ "log",+ "wasm-bindgen",+ "windows-core 0.62.2",+]++[[package]]+name = "iana-time-zone-haiku"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"+dependencies = [+ "cc",+]++[[package]]+name = "icu_collections"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd"+dependencies = [+ "displaydoc",+ "potential_utf",+ "utf8_iter",+ "yoke",+ "zerofrom",+ "zerovec",+]++[[package]]+name = "icu_locale_core"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0"+dependencies = [+ "displaydoc",+ "litemap",+ "serde",+ "tinystr",+ "writeable",+ "zerovec",+]++[[package]]+name = "icu_locale_fallback"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "406e9ae5b95d8aa37db6293405931b766a6172d1848daee22d70eb44aa78a43c"+dependencies = [+ "icu_locale_core",+ "icu_locale_fallback_data",+ "icu_provider",+ "potential_utf",+ "tinystr",+ "zerovec",+]++[[package]]+name = "icu_locale_fallback_data"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3632ebbd0c5c3637ba1a40bdf8288f2cb9d2268e73441a69d5fc73d7cfbaa87c"++[[package]]+name = "icu_normalizer"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599"+dependencies = [+ "icu_collections",+ "icu_normalizer_data",+ "icu_properties",+ "icu_provider",+ "smallvec",+ "zerovec",+]++[[package]]+name = "icu_normalizer_data"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"++[[package]]+name = "icu_properties"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f"+dependencies = [+ "displaydoc",+ "icu_collections",+ "icu_locale_core",+ "icu_properties_data",+ "icu_provider",+ "zerotrie",+ "zerovec",+]++[[package]]+name = "icu_properties_data"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf"++[[package]]+name = "icu_provider"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514"+dependencies = [+ "displaydoc",+ "icu_locale_core",+ "serde",+ "stable_deref_trait",+ "writeable",+ "yoke",+ "zerofrom",+ "zerotrie",+ "zerovec",+]++[[package]]+name = "icu_segmenter"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "61b195dc605f81aa181bec9b3bd14e26cc71b903e4644f6af578ca9772c7a710"+dependencies = [+ "icu_collections",+ "icu_locale_fallback",+ "icu_provider",+ "icu_segmenter_data",+ "potential_utf",+ "smallvec",+ "utf8_iter",+ "zerotrie",+ "zerovec",+]++[[package]]+name = "icu_segmenter_data"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "913a7d294ad056474749152107309fdee3ec17d2482d1ab70fdc61a81c64b9a3"++[[package]]+name = "idna"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"+dependencies = [+ "idna_adapter",+ "smallvec",+ "utf8_iter",+]++[[package]]+name = "idna_adapter"+version = "1.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"+dependencies = [+ "icu_normalizer",+ "icu_properties",+]++[[package]]+name = "ignore"+version = "0.4.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "484be5657551d7868d67587df967fb4fcbe9d266a761cc855aaa148fda0b3cc7"+dependencies = [+ "crossbeam-deque",+ "globset",+ "log",+ "memchr",+ "regex-automata",+ "same-file",+ "walkdir",+ "winapi-util",+]++[[package]]+name = "image"+version = "0.25.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"+dependencies = [+ "bytemuck",+ "byteorder-lite",+ "color_quant",+ "exr",+ "gif 0.14.2",+ "image-webp",+ "moxcms",+ "num-traits",+ "png 0.18.1",+ "qoi",+ "ravif",+ "rayon",+ "tiff",+ "zune-core 0.5.3",+ "zune-jpeg 0.5.15",+]++[[package]]+name = "image-webp"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3"+dependencies = [+ "byteorder-lite",+ "quick-error 2.0.1",+]++[[package]]+name = "imagesize"+version = "0.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285"++[[package]]+name = "imagesize"+version = "0.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09e54e57b4c48b40f7aec75635392b12b3421fa26fe8b4332e63138ed278459c"++[[package]]+name = "imgref"+version = "1.12.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6e44b0a4eaa4c82f441d50a963f2d5f05a787240aeee097597033e72accfd22f"++[[package]]+name = "indexmap"+version = "2.14.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"+dependencies = [+ "equivalent",+ "hashbrown 0.17.1",+ "serde",+ "serde_core",+]++[[package]]+name = "inotify"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4cc00ea907cab49550b7da656f80ebb97be1b997d931fbcd28d39734e17ce592"+dependencies = [+ "bitflags 2.13.2",+ "inotify-sys",+ "libc",+]++[[package]]+name = "inotify-sys"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c033f80b2c113cdf91ab7a33faa9cbc014726dcad99880c8609af2a370edf37d"+dependencies = [+ "libc",+]++[[package]]+name = "inout"+version = "0.1.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"+dependencies = [+ "block-padding",+ "generic-array",+]++[[package]]+name = "instant"+version = "0.1.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"+dependencies = [+ "cfg-if",+ "js-sys",+ "wasm-bindgen",+ "web-sys",+]++[[package]]+name = "interpolate_name"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "inventory"+version = "0.3.25"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6928282826c822ad91bf1c9a1cb90a30ba1c26770749929b4656cd6be829cd7c"+dependencies = [+ "rustversion",+]++[[package]]+name = "ipnet"+version = "2.12.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0"++[[package]]+name = "itertools"+version = "0.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"+dependencies = [+ "either",+]++[[package]]+name = "itertools"+version = "0.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"+dependencies = [+ "either",+]++[[package]]+name = "itertools"+version = "0.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285"+dependencies = [+ "either",+]++[[package]]+name = "itoa"+version = "1.0.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"++[[package]]+name = "jni-sys"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258"+dependencies = [+ "jni-sys 0.4.1",+]++[[package]]+name = "jni-sys"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2"+dependencies = [+ "jni-sys-macros",+]++[[package]]+name = "jni-sys-macros"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264"+dependencies = [+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "jobserver"+version = "0.1.35"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"+dependencies = [+ "getrandom 0.4.3",+ "libc",+]++[[package]]+name = "js-sys"+version = "0.3.107"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a"+dependencies = [+ "cfg-if",+ "futures-util",+ "wasm-bindgen",+]++[[package]]+name = "khronos-egl"+version = "6.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76"+dependencies = [+ "libc",+ "libloading",+ "pkg-config",+]++[[package]]+name = "khronos_api"+version = "3.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"++[[package]]+name = "kqueue"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8d763e5b24120b4ddf50de6c92308156765aabfbbccebf401da7cff2d70a41ea"+dependencies = [+ "kqueue-sys",+ "libc",+]++[[package]]+name = "kqueue-sys"+version = "1.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087"+dependencies = [+ "bitflags 2.13.2",+ "libc",+]++[[package]]+name = "kurbo"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c62026ae44756f8a599ba21140f350303d4f08dcdcc71b5ad9c9bb8128c13c62"+dependencies = [+ "arrayvec",+ "euclid",+ "smallvec",+]++[[package]]+name = "kurbo"+version = "0.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4b60dfc32f652b926df6192e55525b16d186c69d47876c3ead4da5cc9f8450e2"+dependencies = [+ "arrayvec",+ "euclid",+ "polycool",+ "smallvec",+]++[[package]]+name = "lazy_static"+version = "1.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb"++[[package]]+name = "lebe"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8"++[[package]]+name = "libc"+version = "0.2.191"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"++[[package]]+name = "libfuzzer-sys"+version = "0.4.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2"+dependencies = [+ "arbitrary",+ "cc",+]++[[package]]+name = "libloading"+version = "0.8.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"+dependencies = [+ "cfg-if",+ "windows-link 0.2.1",+]++[[package]]+name = "libm"+version = "0.2.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"++[[package]]+name = "libredox"+version = "0.1.25"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d"+dependencies = [+ "libc",+]++[[package]]+name = "linebender_resource_handle"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"++[[package]]+name = "link-section"+version = "0.19.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "39c29a617ce3df32c08497bdc1ab6e2376e0b17948ac166a2fbe5977c5954cd9"++[[package]]+name = "linktime-proc-macro"+version = "0.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7e57c38c1e860fd37c604281cdfb1dd2216977fd76a50f85ba2f388ef3219616"++[[package]]+name = "linux-raw-sys"+version = "0.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"++[[package]]+name = "litemap"+version = "0.8.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"++[[package]]+name = "litrs"+version = "1.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4744e383959f0db86ede514b809b1c53251889093803c05267acc7d4e7030d70"++[[package]]+name = "lock_api"+version = "0.4.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"+dependencies = [+ "scopeguard",+]++[[package]]+name = "log"+version = "0.4.35"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c"+dependencies = [+ "serde_core",+]++[[package]]+name = "loop9"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062"+dependencies = [+ "imgref",+]++[[package]]+name = "lru-slab"+version = "0.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4050469837a6ff301cd14c1f8f24f88549e6d548f24f64e2148eb0f72cebc51f"++[[package]]+name = "lsp-types"+version = "0.97.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "53353550a17c04ac46c585feb189c2db82154fc84b79c7a66c96c2c644f66071"+dependencies = [+ "bitflags 1.3.2",+ "fluent-uri",+ "serde",+ "serde_json",+ "serde_repr",+]++[[package]]+name = "lyon"+version = "1.0.19"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bd0578bdecb7d6d88987b8b2b1e3a4e2f81df9d0ece1078623324a567904e7b7"+dependencies = [+ "lyon_algorithms",+ "lyon_tessellation",+]++[[package]]+name = "lyon_algorithms"+version = "1.0.22"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f3a6b9d4e8b48acd531fbf1241ad9b270df6e60b6b92bdea1469f4f40899d805"+dependencies = [+ "lyon_path",+ "num-traits",+]++[[package]]+name = "lyon_geom"+version = "1.0.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d82dd26aa4dc0b5b70b9115de59824842bcb43cf4a28e1b1e6d0ad148c93f93e"+dependencies = [+ "arrayvec",+ "euclid",+ "num-traits",+]++[[package]]+name = "lyon_path"+version = "1.0.19"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c463f9c428b7fc5ec885dcd39ce4aa61e29111d0e33483f6f98c74e89d8621e"+dependencies = [+ "lyon_geom",+ "num-traits",+]++[[package]]+name = "lyon_tessellation"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd4872650e70dc907dd4f7ebc449d7d657a0d2658e423b2e724970870bbbf75b"+dependencies = [+ "float_next_after",+ "lyon_path",+ "num-traits",+]++[[package]]+name = "mac"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"++[[package]]+name = "mac-notification-sys"+version = "0.6.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd604973958ddcc11b561193c0fb96ba146506ef2f231ef2e7c35fd2cbc9beca"+dependencies = [+ "cc",+ "log",+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+ "time",+ "uuid",+]++[[package]]+name = "mach2"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dae608c151f68243f2b000364e1f7b186d9c29845f7d2d85bd31b9ad77ad552b"++[[package]]+name = "malloc_buf"+version = "0.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"+dependencies = [+ "libc",+]++[[package]]+name = "markdown"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a5cab8f2cadc416a82d2e783a1946388b31654d391d1c7d92cc1f03e295b1deb"+dependencies = [+ "serde",+ "unicode-id",+]++[[package]]+name = "markup5ever"+version = "0.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45"+dependencies = [+ "log",+ "phf",+ "phf_codegen",+ "string_cache",+ "string_cache_codegen",+ "tendril",+]++[[package]]+name = "markup5ever_rcdom"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "edaa21ab3701bfee5099ade5f7e1f84553fd19228cf332f13cd6e964bf59be18"+dependencies = [+ "html5ever",+ "markup5ever",+ "tendril",+ "xml5ever",+]++[[package]]+name = "maybe-rayon"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519"+dependencies = [+ "cfg-if",+ "rayon",+]++[[package]]+name = "md-5"+version = "0.10.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"+dependencies = [+ "cfg-if",+ "digest 0.10.7",+]++[[package]]+name = "memchr"+version = "2.8.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"++[[package]]+name = "memmap2"+version = "0.9.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6b0ca1155a9ecc25aa12e8313a119f32edf0255fea2f44839c4ac0a12b2ac157"+dependencies = [+ "libc",+]++[[package]]+name = "memoffset"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"+dependencies = [+ "autocfg",+]++[[package]]+name = "mime"+version = "0.3.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"++[[package]]+name = "mime_guess"+version = "2.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"+dependencies = [+ "mime",+ "unicase",+]++[[package]]+name = "miniz_oxide"+version = "0.8.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"+dependencies = [+ "adler2",+ "simd-adler32",+]++[[package]]+name = "miniz_oxide"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c"+dependencies = [+ "adler2",+ "simd-adler32",+]++[[package]]+name = "mio"+version = "1.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee"+dependencies = [+ "libc",+ "log",+ "wasi",+ "windows-sys 0.61.2",+]++[[package]]+name = "moxcms"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"+dependencies = [+ "num-traits",+ "pxfm",+]++[[package]]+name = "multiversion_no_op"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d"++[[package]]+name = "naga"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a616d2fb8c89516ac2723a581f69d6c18576046bed761bd6b305e5618e6ae130"+dependencies = [+ "arrayvec",+ "bit-set 0.10.0",+ "bitflags 2.13.2",+ "cfg-if",+ "cfg_aliases",+ "codespan-reporting",+ "half",+ "hashbrown 0.17.1",+ "indexmap",+ "libm",+ "log",+ "naga-types",+ "num-traits",+ "once_cell",+ "rustc-hash 1.1.0",+ "spirv",+ "thiserror 2.0.21",+ "unicode-ident",+]++[[package]]+name = "naga-types"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "590afbf58a6f4f62873cd5cff4468061844bafa1cdf399cc954537c22d768d49"+dependencies = [+ "hashbrown 0.17.1",+ "indexmap",+ "rustc-hash 1.1.0",+ "thiserror 2.0.21",+]++[[package]]+name = "ndk-sys"+version = "0.6.0+11769913"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873"+dependencies = [+ "jni-sys 0.3.1",+]++[[package]]+name = "new_debug_unreachable"+version = "1.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"++[[package]]+name = "no_std_io2"+version = "0.9.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "418abd1b6d34fbf6cae440dc874771b0525a604428704c76e48b29a5e67b8003"+dependencies = [+ "memchr",+]++[[package]]+name = "nohash-hasher"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"++[[package]]+name = "nom"+version = "8.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405"+dependencies = [+ "memchr",+]++[[package]]+name = "noop_proc_macro"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8"++[[package]]+name = "normpath"+version = "1.5.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b11ce00d2594068e8a27c9146fdc5cf9f3ac38eb42c7cd34d05fea618873ac9f"+dependencies = [+ "windows-sys 0.61.2",+]++[[package]]+name = "notify"+version = "8.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "82f812702fbc75d35416d3f884e04925be7e9498f4eceea2e24ba34559284674"+dependencies = [+ "bitflags 2.13.2",+ "inotify",+ "kqueue",+ "libc",+ "log",+ "mio",+ "notify-types",+ "objc2-core-foundation",+ "objc2-core-services",+ "walkdir",+ "windows-sys 0.61.2",+]++[[package]]+name = "notify-rust"+version = "4.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "50ff2e74231b72c832d82982193b417f230945be6bdb5575b251d941d31adb00"+dependencies = [+ "futures-lite",+ "log",+ "mac-notification-sys",+ "serde",+ "tauri-winrt-notification",+ "zbus",+]++[[package]]+name = "notify-types"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0a437a9308232ce794b1e7fdf540d38ea37efc3c73492640c13b4c8568b8f108"+dependencies = [+ "bitflags 2.13.2",+]++[[package]]+name = "ntapi"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae"+dependencies = [+ "winapi",+]++[[package]]+name = "num"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"+dependencies = [+ "num-bigint",+ "num-complex",+ "num-integer",+ "num-iter",+ "num-rational",+ "num-traits",+]++[[package]]+name = "num-bigint"+version = "0.4.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367"+dependencies = [+ "num-integer",+ "num-traits",+]++[[package]]+name = "num-bigint-dig"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a7f9a86e097b0d187ad0e65667c2f58b9254671e86e7dbb78036b16692eae099"+dependencies = [+ "libm",+ "num-integer",+ "num-iter",+ "num-traits",+ "once_cell",+ "rand 0.9.5",+ "serde",+ "smallvec",+ "zeroize",+]++[[package]]+name = "num-complex"+version = "0.4.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"+dependencies = [+ "bytemuck",+ "num-traits",+]++[[package]]+name = "num-conv"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"++[[package]]+name = "num-derive"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "num-integer"+version = "0.1.47"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"+dependencies = [+ "num-traits",+]++[[package]]+name = "num-iter"+version = "0.1.46"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b"+dependencies = [+ "num-integer",+ "num-traits",+]++[[package]]+name = "num-rational"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"+dependencies = [+ "num-bigint",+ "num-integer",+ "num-traits",+]++[[package]]+name = "num-traits"+version = "0.2.19"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"+dependencies = [+ "autocfg",+ "libm",+]++[[package]]+name = "num_cpus"+version = "1.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b"+dependencies = [+ "hermit-abi",+ "libc",+]++[[package]]+name = "objc"+version = "0.2.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"+dependencies = [+ "malloc_buf",+ "objc_exception",+]++[[package]]+name = "objc-foundation"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"+dependencies = [+ "block",+ "objc",+ "objc_id",+]++[[package]]+name = "objc-sys"+version = "0.3.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310"++[[package]]+name = "objc2"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "19d5490aaf8f1d7cf7688dfa9b0ce07900e168852c45cd2c03f534dfd27cfd0b"+dependencies = [+ "objc-sys",+ "objc2-encode",+]++[[package]]+name = "objc2"+version = "0.6.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8"+dependencies = [+ "objc2-encode",+]++[[package]]+name = "objc2-app-kit"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.5.1",+ "libc",+ "objc2 0.5.3",+ "objc2-core-data 0.2.2",+ "objc2-core-image 0.2.2",+ "objc2-foundation 0.2.2",+ "objc2-quartz-core 0.2.2",+]++[[package]]+name = "objc2-app-kit"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "libc",+ "objc2 0.6.5",+ "objc2-cloud-kit",+ "objc2-core-data 0.3.2",+ "objc2-core-foundation",+ "objc2-core-graphics",+ "objc2-core-image 0.3.2",+ "objc2-core-text",+ "objc2-core-video",+ "objc2-foundation 0.3.2",+ "objc2-quartz-core 0.3.2",+ "objc2-uniform-type-identifiers",+]++[[package]]+name = "objc2-cloud-kit"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc2-core-data"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.5.1",+ "objc2 0.5.3",+ "objc2-foundation 0.2.2",+]++[[package]]+name = "objc2-core-data"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc2-core-foundation"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "dispatch2",+ "libc",+ "objc2 0.6.5",+]++[[package]]+name = "objc2-core-graphics"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807"+dependencies = [+ "bitflags 2.13.2",+ "dispatch2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-io-surface",+]++[[package]]+name = "objc2-core-image"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80"+dependencies = [+ "block2 0.5.1",+ "objc2 0.5.3",+ "objc2-foundation 0.2.2",+ "objc2-metal 0.2.2",+]++[[package]]+name = "objc2-core-image"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006"+dependencies = [+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc2-core-services"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "583300ad934cba24ff5292aee751ecc070f7ca6b39a574cc21b7b5e588e06a0b"+dependencies = [+ "libc",+ "objc2-core-foundation",+]++[[package]]+name = "objc2-core-text"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-core-graphics",+]++[[package]]+name = "objc2-core-video"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-core-graphics",+ "objc2-io-surface",+ "objc2-metal 0.3.2",+]++[[package]]+name = "objc2-encode"+version = "4.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"++[[package]]+name = "objc2-foundation"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.5.1",+ "libc",+ "objc2 0.5.3",+]++[[package]]+name = "objc2-foundation"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "libc",+ "objc2 0.6.5",+ "objc2-core-foundation",+]++[[package]]+name = "objc2-io-surface"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-core-foundation",+]++[[package]]+name = "objc2-metal"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.5.1",+ "objc2 0.5.3",+ "objc2-foundation 0.2.2",+]++[[package]]+name = "objc2-metal"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "dispatch2",+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc2-quartz-core"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.5.1",+ "objc2 0.5.3",+ "objc2-foundation 0.2.2",+ "objc2-metal 0.2.2",+]++[[package]]+name = "objc2-quartz-core"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-core-graphics",+ "objc2-foundation 0.3.2",+ "objc2-metal 0.3.2",+]++[[package]]+name = "objc2-security"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a"+dependencies = [+ "objc2-core-foundation",+]++[[package]]+name = "objc2-ui-kit"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-foundation 0.3.2",+ "objc2-quartz-core 0.3.2",+]++[[package]]+name = "objc2-uniform-type-identifiers"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7902ac02859fc1f7045f8b598c63f1ae0cc7efeaa06a9bc9f3d9a3c955974fa4"+dependencies = [+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc2-user-notifications"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc_exception"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4"+dependencies = [+ "cc",+]++[[package]]+name = "objc_id"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b"+dependencies = [+ "objc",+]++[[package]]+name = "object"+version = "0.40.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dd229a0361b9d0d4396176e02d65897f487eebeab7caa6d443855ee152ca0b9c"+dependencies = [+ "memchr",+]++[[package]]+name = "once_cell"+version = "1.21.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"++[[package]]+name = "oo7"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "78f2bfed90f1618b4b48dcad9307f25e14ae894e2949642c87c351601d62cebd"+dependencies = [+ "aes",+ "ashpd",+ "async-fs",+ "async-io",+ "async-lock",+ "blocking",+ "cbc",+ "cipher",+ "digest 0.10.7",+ "endi",+ "futures-lite",+ "futures-util",+ "getrandom 0.4.3",+ "hkdf",+ "hmac",+ "md-5",+ "num",+ "num-bigint-dig",+ "pbkdf2",+ "serde",+ "serde_bytes",+ "sha2 0.10.9",+ "subtle",+ "zbus",+ "zbus_macros",+ "zeroize",+ "zvariant",+]++[[package]]+name = "oorandom"+version = "11.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"++[[package]]+name = "openssl-probe"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1"++[[package]]+name = "option-ext"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"++[[package]]+name = "ordered-float"+version = "5.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c860fd3227ca4ac3cc032e2cd20cba3f02ccdf4b610538f8ee6584d56bb62e96"+dependencies = [+ "num-traits",+]++[[package]]+name = "ordered-stream"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"+dependencies = [+ "futures-core",+ "pin-project-lite",+]++[[package]]+name = "page_size"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da"+dependencies = [+ "libc",+ "winapi",+]++[[package]]+name = "parking"+version = "2.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"++[[package]]+name = "parking_lot"+version = "0.12.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"+dependencies = [+ "lock_api",+ "parking_lot_core",+]++[[package]]+name = "parking_lot_core"+version = "0.9.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"+dependencies = [+ "cfg-if",+ "libc",+ "redox_syscall",+ "smallvec",+ "windows-link 0.2.1",+]++[[package]]+name = "paste"+version = "1.0.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"++[[package]]+name = "pastey"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec"++[[package]]+name = "pathfinder_geometry"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3"+dependencies = [+ "log",+ "pathfinder_simd",+]++[[package]]+name = "pathfinder_simd"+version = "0.5.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4500030c302e4af1d423f36f3b958d1aecb6c04184356ed5a833bf6b60435777"+dependencies = [+ "rustc_version",+]++[[package]]+name = "pbkdf2"+version = "0.12.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"+dependencies = [+ "digest 0.10.7",+ "hmac",+]++[[package]]+name = "percent-encoding"+version = "2.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"++[[package]]+name = "perf-event-data"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "575828d9d7d205188048eb1508560607a03d21eafdbba47b8cade1736c1c28e1"+dependencies = [+ "bitflags 2.13.2",+ "c-enum",+ "perf-event-open-sys2",+]++[[package]]+name = "perf-event-open-sys2"+version = "5.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d9c25955321465255e437600b54296983fab1feac2cd0c38958adeb26dbae49e"+dependencies = [+ "libc",+ "memoffset",+]++[[package]]+name = "perf-event2"+version = "0.7.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0939b8fad77dfaeb29ebbd35faaeaadbf833167f30975f1b8993bbba09ea0a0f"+dependencies = [+ "bitflags 2.13.2",+ "c-enum",+ "libc",+ "memmap2",+ "perf-event-data",+ "perf-event-open-sys2",+]++[[package]]+name = "phf"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"+dependencies = [+ "phf_shared",+]++[[package]]+name = "phf_codegen"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a"+dependencies = [+ "phf_generator",+ "phf_shared",+]++[[package]]+name = "phf_generator"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"+dependencies = [+ "phf_shared",+ "rand 0.8.8",+]++[[package]]+name = "phf_shared"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"+dependencies = [+ "siphasher",+]++[[package]]+name = "pico-args"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"++[[package]]+name = "pin-project"+version = "1.1.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924"+dependencies = [+ "pin-project-internal",+]++[[package]]+name = "pin-project-internal"+version = "1.1.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "pin-project-lite"+version = "0.2.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"++[[package]]+name = "piper"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"+dependencies = [+ "atomic-waker",+ "fastrand",+ "futures-io",+]++[[package]]+name = "pkg-config"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"++[[package]]+name = "plotters"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747"+dependencies = [+ "num-traits",+ "plotters-backend",+ "plotters-svg",+ "wasm-bindgen",+ "web-sys",+]++[[package]]+name = "plotters-backend"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a"++[[package]]+name = "plotters-svg"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670"+dependencies = [+ "plotters-backend",+]++[[package]]+name = "png"+version = "0.17.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526"+dependencies = [+ "bitflags 1.3.2",+ "crc32fast",+ "fdeflate",+ "flate2",+ "miniz_oxide 0.8.9",+]++[[package]]+name = "png"+version = "0.18.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"+dependencies = [+ "bitflags 2.13.2",+ "crc32fast",+ "fdeflate",+ "flate2",+ "miniz_oxide 0.8.9",+]++[[package]]+name = "polling"+version = "3.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"+dependencies = [+ "cfg-if",+ "concurrent-queue",+ "hermit-abi",+ "pin-project-lite",+ "rustix",+ "windows-sys 0.61.2",+]++[[package]]+name = "pollster"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7"++[[package]]+name = "pollster"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"++[[package]]+name = "polycool"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "50596ddc09eb5ad5f75cacd40209568e66df71baf86e1499a0e99c4cff12a5a6"+dependencies = [+ "arrayvec",+]++[[package]]+name = "portable-atomic"+version = "1.15.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"++[[package]]+name = "portable-atomic-util"+version = "0.2.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715"+dependencies = [+ "portable-atomic",+]++[[package]]+name = "postage"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "af3fb618632874fb76937c2361a7f22afd393c982a2165595407edc75b06d3c1"+dependencies = [+ "atomic",+ "crossbeam-queue",+ "parking_lot",+ "pin-project",+ "pollster 0.2.5",+ "static_assertions",+ "thiserror 1.0.69",+]++[[package]]+name = "potential_utf"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"+dependencies = [+ "serde_core",+ "writeable",+ "zerovec",+]++[[package]]+name = "powerfmt"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958"++[[package]]+name = "ppv-lite86"+version = "0.2.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"+dependencies = [+ "zerocopy",+]++[[package]]+name = "precomputed-hash"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"++[[package]]+name = "presser"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa"++[[package]]+name = "proc-macro-crate"+version = "3.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"+dependencies = [+ "toml_edit 0.25.18+spec-1.1.0",+]++[[package]]+name = "proc-macro2"+version = "1.0.107"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"+dependencies = [+ "unicode-ident",+]++[[package]]+name = "profiling"+version = "1.0.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5"+dependencies = [+ "profiling-procmacros",+]++[[package]]+name = "profiling-procmacros"+version = "1.0.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb"+dependencies = [+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "proptest"+version = "1.12.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b8530004ccb15eae51c7e40009fbe317f341f804db54dc033eec1c50be28cfa0"+dependencies = [+ "bit-set 0.11.1",+ "bit-vec 0.10.1",+ "bitflags 2.13.2",+ "chacha20",+ "core_detect",+ "num-traits",+ "proptest-macro",+ "rand 0.10.3",+ "rand_xorshift",+ "regex-syntax",+ "rusty-fork",+ "tempfile",+ "unarray",+]++[[package]]+name = "proptest-macro"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e99782ea31698c2206c6887c1220d2f594b291c26cb9ec5b6d7cf175320bc212"+dependencies = [+ "convert_case 0.11.0",+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "pulp"+version = "0.22.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "046aa45b989642ec2e4717c8e72d677b13edd831a4d3b6cf37d9a3e54912496a"+dependencies = [+ "bytemuck",+ "cfg-if",+ "libm",+ "num-complex",+ "paste",+ "pulp-wasm-simd-flag",+ "raw-cpuid",+ "reborrow",+ "version_check",+]++[[package]]+name = "pulp-wasm-simd-flag"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1d8f70e07b9c3962945a74e59ca1c511bba65b6419468acc217c457d93f3c740"++[[package]]+name = "pxfm"+version = "0.1.30"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"++[[package]]+name = "qoi"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001"+dependencies = [+ "bytemuck",+]++[[package]]+name = "quick-error"+version = "1.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"++[[package]]+name = "quick-error"+version = "2.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"++[[package]]+name = "quick-xml"+version = "0.41.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1"+dependencies = [+ "memchr",+]++[[package]]+name = "quinn"+version = "0.11.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4051e23e9185c255a7e33ef59cdbca87a22d359052eecd22fc6b901fb37d9d11"+dependencies = [+ "bytes",+ "cfg_aliases",+ "pin-project-lite",+ "quinn-proto",+ "quinn-udp",+ "rustc-hash 2.1.3",+ "rustls",+ "socket2",+ "thiserror 2.0.21",+ "tokio",+ "tracing",+ "web-time",+]++[[package]]+name = "quinn-proto"+version = "0.11.19"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0e750cca55fe4f0439a15d0bb529da9651e79993e8e72c61a899a36d462befbe"+dependencies = [+ "bytes",+ "getrandom 0.4.3",+ "lru-slab",+ "rand 0.10.3",+ "rand_pcg",+ "ring",+ "rustc-hash 2.1.3",+ "rustls",+ "rustls-pki-types",+ "slab",+ "thiserror 2.0.21",+ "tinyvec",+ "tracing",+ "web-time",+]++[[package]]+name = "quinn-udp"+version = "0.5.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "af66907df18639dcf4db56ca65490cabc4b27a97dbadd96f2926cca73298f016"+dependencies = [+ "cfg_aliases",+ "libc",+ "once_cell",+ "socket2",+ "tracing",+ "windows-sys 0.61.2",+]++[[package]]+name = "quote"+version = "1.0.47"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"+dependencies = [+ "proc-macro2",+]++[[package]]+name = "r-efi"+version = "5.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"++[[package]]+name = "r-efi"+version = "6.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"++[[package]]+name = "rand"+version = "0.8.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c"+dependencies = [+ "libc",+ "rand_chacha 0.3.1",+ "rand_core 0.6.4",+]++[[package]]+name = "rand"+version = "0.9.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"+dependencies = [+ "rand_chacha 0.9.0",+ "rand_core 0.9.5",+]++[[package]]+name = "rand"+version = "0.10.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af"+dependencies = [+ "chacha20",+ "getrandom 0.4.3",+ "rand_core 0.10.1",+]++[[package]]+name = "rand_chacha"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"+dependencies = [+ "ppv-lite86",+ "rand_core 0.6.4",+]++[[package]]+name = "rand_chacha"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"+dependencies = [+ "ppv-lite86",+ "rand_core 0.9.5",+]++[[package]]+name = "rand_core"+version = "0.6.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"+dependencies = [+ "getrandom 0.2.17",+]++[[package]]+name = "rand_core"+version = "0.9.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"+dependencies = [+ "getrandom 0.3.4",+]++[[package]]+name = "rand_core"+version = "0.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"++[[package]]+name = "rand_pcg"+version = "0.10.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a"+dependencies = [+ "rand_core 0.10.1",+]++[[package]]+name = "rand_xorshift"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "60aa6af80be32871323012e02e6e65f8a7cc7890931ae421d217ad8fe0df2ccf"+dependencies = [+ "rand_core 0.10.1",+]++[[package]]+name = "range-alloc"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08"++[[package]]+name = "rangemap"+version = "1.8.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a611d15b50743feb4c76b7d03edcb0e64f399c26961e4efe6975bc398be6aa3d"++[[package]]+name = "rav1e"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b"+dependencies = [+ "aligned-vec",+ "arbitrary",+ "arg_enum_proc_macro",+ "arrayvec",+ "av-scenechange",+ "av1-grain",+ "bitstream-io",+ "built",+ "cfg-if",+ "interpolate_name",+ "itertools 0.14.0",+ "libc",+ "libfuzzer-sys",+ "log",+ "maybe-rayon",+ "new_debug_unreachable",+ "noop_proc_macro",+ "num-derive",+ "num-traits",+ "paste",+ "profiling",+ "rand 0.9.5",+ "rand_chacha 0.9.0",+ "simd_helpers",+ "thiserror 2.0.21",+ "v_frame",+ "wasm-bindgen",+]++[[package]]+name = "ravif"+version = "0.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e52310197d971b0f5be7fe6b57530dcd27beb35c1b013f29d66c1ad73fbbcc45"+dependencies = [+ "avif-serialize",+ "imgref",+ "loop9",+ "quick-error 2.0.1",+ "rav1e",+ "rayon",+ "rgb",+]++[[package]]+name = "raw-cpuid"+version = "11.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186"+dependencies = [+ "bitflags 2.13.2",+]++[[package]]+name = "raw-window-handle"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539"++[[package]]+name = "raw-window-metal"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135"+dependencies = [+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-foundation 0.3.2",+ "objc2-quartz-core 0.3.2",+]++[[package]]+name = "rayon"+version = "1.12.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"+dependencies = [+ "either",+ "rayon-core",+]++[[package]]+name = "rayon-core"+version = "1.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"+dependencies = [+ "crossbeam-deque",+ "crossbeam-utils",+]++[[package]]+name = "read-fonts"+version = "0.37.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7b634fabf032fab15307ffd272149b622260f55974d9fad689292a5d33df02e5"+dependencies = [+ "bytemuck",+ "core_maths",+ "font-types 0.11.3",+]++[[package]]+name = "read-fonts"+version = "0.41.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "046a7d674daf459825b32f5062056d6882db0d2f5a479fbd76ccfc870ac18709"+dependencies = [+ "bytemuck",+ "font-types 0.12.7",+ "once_cell",+]++[[package]]+name = "reborrow"+version = "0.5.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430"++[[package]]+name = "redox_syscall"+version = "0.5.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"+dependencies = [+ "bitflags 2.13.2",+]++[[package]]+name = "redox_users"+version = "0.4.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"+dependencies = [+ "getrandom 0.2.17",+ "libredox",+ "thiserror 1.0.69",+]++[[package]]+name = "redox_users"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0"+dependencies = [+ "libredox",+ "thiserror 2.0.21",+]++[[package]]+name = "ref-cast"+version = "1.0.27"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3"+dependencies = [+ "ref-cast-impl",+]++[[package]]+name = "ref-cast-impl"+version = "1.0.27"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "regex"+version = "1.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"+dependencies = [+ "aho-corasick",+ "memchr",+ "regex-automata",+ "regex-syntax",+]++[[package]]+name = "regex-automata"+version = "0.4.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"+dependencies = [+ "aho-corasick",+ "memchr",+ "regex-syntax",+]++[[package]]+name = "regex-syntax"+version = "0.8.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"++[[package]]+name = "renderdoc-sys"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"++[[package]]+name = "resvg"+version = "0.45.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43"+dependencies = [+ "gif 0.13.3",+ "image-webp",+ "log",+ "pico-args",+ "rgb",+ "svgtypes 0.15.3",+ "tiny-skia",+ "usvg 0.45.1",+ "zune-jpeg 0.4.21",+]++[[package]]+name = "resvg"+version = "0.46.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b563218631706d614e23059436526d005b50ab5f2d506b55a17eb65c5eb83419"+dependencies = [+ "gif 0.14.2",+ "image-webp",+ "log",+ "pico-args",+ "rgb",+ "svgtypes 0.16.2",+ "tiny-skia",+ "usvg 0.46.0",+ "zune-jpeg 0.5.15",+]++[[package]]+name = "rgb"+version = "0.8.53"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4"+dependencies = [+ "bytemuck",+]++[[package]]+name = "ring"+version = "0.17.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"+dependencies = [+ "cc",+ "cfg-if",+ "getrandom 0.2.17",+ "libc",+ "untrusted",+ "windows-sys 0.52.0",+]++[[package]]+name = "ropey"+version = "2.0.0-beta.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4045a00dc327d084a2bbf126976e14125b54f23bd30511d45b842eba76c52d74"+dependencies = [+ "str_indices",+]++[[package]]+name = "roxmltree"+version = "0.20.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"++[[package]]+name = "roxmltree"+version = "0.21.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9da7f59328b09405b181fee1018925fad50f157afb43c0c0f5c522c256dd5907"+dependencies = [+ "memchr",+]++[[package]]+name = "rust-embed"+version = "8.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "19afa5b4b6a611de00bd1bdae6ae6f39084c9399f0679c3f52d8469cf335cc23"+dependencies = [+ "rust-embed-impl",+ "rust-embed-utils",+ "walkdir",+]++[[package]]+name = "rust-embed-impl"+version = "8.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e0d8afda6374eac59e066abee06d265247ebbaf3006cf878e2879e8356e34053"+dependencies = [+ "mime_guess",+ "proc-macro2",+ "quote",+ "rust-embed-utils",+ "shellexpand",+ "syn 2.0.119",+ "walkdir",+]++[[package]]+name = "rust-embed-utils"+version = "8.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d84e8ba78bd384263e5922f084cbe1b081c3b7e69add59c8fb097b879ba968a"+dependencies = [+ "globset",+ "sha2 0.11.1",+ "walkdir",+]++[[package]]+name = "rust-i18n"+version = "4.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8502e73e6461c738659455c5d2cf95bc132760a6f203c717e66ee72b78906d7f"+dependencies = [+ "globwalk",+ "regex",+ "rust-i18n-macro",+ "rust-i18n-support",+ "smallvec",+]++[[package]]+name = "rust-i18n-macro"+version = "4.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d54a28dd9d46108d56b9f0c85b220908844233e561c03087890325104f90f2c6"+dependencies = [+ "glob",+ "proc-macro2",+ "quote",+ "rust-i18n-support",+ "serde",+ "serde_json",+ "syn 2.0.119",+]++[[package]]+name = "rust-i18n-support"+version = "4.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e806c2a9701cbd6043992cd935c30cb1fdb128fa15e7b506f3b46f97045737c0"+dependencies = [+ "arc-swap",+ "base62",+ "foldhash",+ "globwalk",+ "itertools 0.11.0",+ "normpath",+ "serde",+ "serde-saphyr",+ "serde_json",+ "siphasher",+ "toml 0.8.23",+ "triomphe",+]++[[package]]+name = "rustc-demangle"+version = "0.1.28"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb"++[[package]]+name = "rustc-hash"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"++[[package]]+name = "rustc-hash"+version = "2.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"++[[package]]+name = "rustc_version"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"+dependencies = [+ "semver",+]++[[package]]+name = "rustix"+version = "1.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa"+dependencies = [+ "bitflags 2.13.2",+ "errno",+ "libc",+ "linux-raw-sys",+ "windows-sys 0.61.2",+]++[[package]]+name = "rustls"+version = "0.23.46"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"+dependencies = [+ "once_cell",+ "ring",+ "rustls-pki-types",+ "rustls-webpki",+ "subtle",+ "zeroize",+]++[[package]]+name = "rustls-native-certs"+version = "0.8.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4"+dependencies = [+ "openssl-probe",+ "rustls-pki-types",+ "schannel",+ "security-framework",+]++[[package]]+name = "rustls-pemfile"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50"+dependencies = [+ "rustls-pki-types",+]++[[package]]+name = "rustls-pki-types"+version = "1.15.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"+dependencies = [+ "web-time",+ "zeroize",+]++[[package]]+name = "rustls-webpki"+version = "0.103.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281"+dependencies = [+ "ring",+ "rustls-pki-types",+ "untrusted",+]++[[package]]+name = "rustversion"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"++[[package]]+name = "rusty-fork"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2"+dependencies = [+ "fnv",+ "quick-error 1.2.3",+ "tempfile",+ "wait-timeout",+]++[[package]]+name = "rustybuzz"+version = "0.20.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702"+dependencies = [+ "bitflags 2.13.2",+ "bytemuck",+ "core_maths",+ "log",+ "smallvec",+ "ttf-parser",+ "unicode-bidi-mirroring",+ "unicode-ccc",+ "unicode-properties",+ "unicode-script",+]++[[package]]+name = "ryu"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"++[[package]]+name = "same-file"+version = "1.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"+dependencies = [+ "winapi-util",+]++[[package]]+name = "schannel"+version = "0.1.30"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5"+dependencies = [+ "windows-sys 0.61.2",+]++[[package]]+name = "schemars"+version = "1.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e"+dependencies = [+ "dyn-clone",+ "indexmap",+ "ref-cast",+ "schemars_derive",+ "serde",+ "serde_json",+]++[[package]]+name = "schemars_derive"+version = "1.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e1c3a92094fa7d61aa124645844facb6b554dfc797136d0f5fd1f890e2bffc69"+dependencies = [+ "proc-macro2",+ "quote",+ "serde_derive_internals",+ "syn 3.0.9",+]++[[package]]+name = "scopeguard"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"++[[package]]+name = "screencapturekit"+version = "0.2.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1a5eeeb57ac94960cfe5ff4c402be6585ae4c8d29a2cf41b276048c2e849d64e"+dependencies = [+ "screencapturekit-sys",+]++[[package]]+name = "screencapturekit-sys"+version = "0.2.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "22411b57f7d49e7fe08025198813ee6fd65e1ee5eff4ebc7880c12c82bde4c60"+dependencies = [+ "block",+ "dispatch",+ "objc",+ "objc-foundation",+ "objc_id",+ "once_cell",+]++[[package]]+name = "seahash"+version = "4.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"++[[package]]+name = "security-framework"+version = "3.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"+dependencies = [+ "bitflags 2.13.2",+ "core-foundation 0.10.1",+ "core-foundation-sys",+ "libc",+ "security-framework-sys",+]++[[package]]+name = "security-framework-sys"+version = "2.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3"+dependencies = [+ "core-foundation-sys",+ "libc",+]++[[package]]+name = "self_cell"+version = "1.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2ab42ca02749e120097e328d91d415325bdf43b1c72c4c8badf37375fe40a813"++[[package]]+name = "semver"+version = "1.0.28"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"+dependencies = [+ "serde",+ "serde_core",+]++[[package]]+name = "serde"+version = "1.0.229"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"+dependencies = [+ "serde_core",+ "serde_derive",+]++[[package]]+name = "serde-saphyr"+version = "1.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b8050abb251097357e24aff63ba2c52a6309ecb7d23a5474023df960a02694d8"+dependencies = [+ "annotate-snippets",+ "base64 0.23.1",+ "encoding_rs_io",+ "granit-parser",+ "nohash-hasher",+ "num-traits",+ "serde_core",+ "smallvec",+ "zmij",+]++[[package]]+name = "serde_bytes"+version = "0.11.19"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8"+dependencies = [+ "serde",+ "serde_core",+]++[[package]]+name = "serde_core"+version = "1.0.229"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"+dependencies = [+ "serde_derive",+]++[[package]]+name = "serde_derive"+version = "1.0.229"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "serde_derive_internals"+version = "0.30.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "serde_json"+version = "1.0.154"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"+dependencies = [+ "foldhash",+ "indexmap",+ "itoa",+ "memchr",+ "serde",+ "serde_core",+ "zmij",+]++[[package]]+name = "serde_repr"+version = "0.1.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "serde_spanned"+version = "0.6.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"+dependencies = [+ "serde",+]++[[package]]+name = "serde_spanned"+version = "1.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c"+dependencies = [+ "serde_core",+]++[[package]]+name = "serde_urlencoded"+version = "0.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"+dependencies = [+ "form_urlencoded",+ "itoa",+ "ryu",+ "serde",+]++[[package]]+name = "sha1_smol"+version = "1.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d"++[[package]]+name = "sha2"+version = "0.10.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"+dependencies = [+ "cfg-if",+ "cpufeatures 0.2.17",+ "digest 0.10.7",+]++[[package]]+name = "sha2"+version = "0.11.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19"+dependencies = [+ "cfg-if",+ "cpufeatures 0.3.1",+ "digest 0.11.3",+]++[[package]]+name = "shellexpand"+version = "3.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8"+dependencies = [+ "dirs 6.0.0",+]++[[package]]+name = "shlex"+version = "2.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"++[[package]]+name = "signal-hook-registry"+version = "1.4.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"+dependencies = [+ "errno",+ "libc",+]++[[package]]+name = "simd-adler32"+version = "0.3.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"++[[package]]+name = "simd_helpers"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6"+dependencies = [+ "quote",+]++[[package]]+name = "simdutf8"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"++[[package]]+name = "similar"+version = "2.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa"+dependencies = [+ "bstr",+ "unicode-segmentation",+]++[[package]]+name = "simplecss"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c"+dependencies = [+ "log",+]++[[package]]+name = "siphasher"+version = "1.0.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256"++[[package]]+name = "skrifa"+version = "0.40.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7fbdfe3d2475fbd7ddd1f3e5cf8288a30eb3e5f95832829570cd88115a7434ac"+dependencies = [+ "bytemuck",+ "read-fonts 0.37.0",+]++[[package]]+name = "skrifa"+version = "0.44.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "819ab7d62b1d3e72d9d9dea5650bac30424f9111364bb94928dbf5ecad1baa68"+dependencies = [+ "bytemuck",+ "read-fonts 0.41.0",+]++[[package]]+name = "slab"+version = "0.4.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"++[[package]]+name = "slotmap"+version = "1.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038"+dependencies = [+ "version_check",+]++[[package]]+name = "smallvec"+version = "1.16.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8"++[[package]]+name = "smol"+version = "2.0.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a33bd3e260892199c3ccfc487c88b2da2265080acb316cd920da72fdfd7c599f"+dependencies = [+ "async-channel",+ "async-executor",+ "async-fs",+ "async-io",+ "async-lock",+ "async-net",+ "async-process",+ "blocking",+ "futures-lite",+]++[[package]]+name = "smol_str"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eeb7109d23f319619d4cc0de5464613c8b7b1a09db2774a58101459cf6be2f10"+dependencies = [+ "serde_core",+]++[[package]]+name = "socket2"+version = "0.6.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"+dependencies = [+ "libc",+ "windows-sys 0.61.2",+]++[[package]]+name = "spin"+version = "0.9.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e"+dependencies = [+ "lock_api",+]++[[package]]+name = "spin"+version = "0.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "023a211cb3138dbc438680b32560ad89f699977624c9f8dbb95a47d5b4c07dd3"+dependencies = [+ "lock_api",+]++[[package]]+name = "spirv"+version = "0.4.0+sdk-1.4.341.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d9571ea910ebd84c86af4b3ed27f9dbdc6ad06f17c5f96146b2b671e2976744f"+dependencies = [+ "bitflags 2.13.2",+]++[[package]]+name = "stable_deref_trait"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"++[[package]]+name = "static_assertions"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"++[[package]]+name = "str_indices"+version = "0.4.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d08889ec5408683408db66ad89e0e1f93dff55c73a4ccc71c427d5b277ee47e6"++[[package]]+name = "strict-num"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"+dependencies = [+ "float-cmp",+]++[[package]]+name = "string_cache"+version = "0.8.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f"+dependencies = [+ "new_debug_unreachable",+ "parking_lot",+ "phf_shared",+ "precomputed-hash",+ "serde",+]++[[package]]+name = "string_cache_codegen"+version = "0.5.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0"+dependencies = [+ "phf_generator",+ "phf_shared",+ "proc-macro2",+ "quote",+]++[[package]]+name = "strum"+version = "0.28.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd"+dependencies = [+ "strum_macros",+]++[[package]]+name = "strum_macros"+version = "0.28.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664"+dependencies = [+ "heck 0.5.0",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "subtle"+version = "2.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"++[[package]]+name = "svg_fmt"+version = "0.4.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb"++[[package]]+name = "svgtypes"+version = "0.15.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc"+dependencies = [+ "kurbo 0.11.3",+ "siphasher",+]++[[package]]+name = "svgtypes"+version = "0.16.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9f12b12995e3638c70618c1facb1ce65302f6a6f706b675f07c58a5d7391120e"+dependencies = [+ "kurbo 0.13.1",+ "siphasher",+]++[[package]]+name = "swash"+version = "0.2.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6c2499c2d826531388872b2268718aed907a39bd785ab0dcfe57fab26283f92e"+dependencies = [+ "skrifa 0.44.0",+ "yazi",+ "zeno",+]++[[package]]+name = "syn"+version = "2.0.119"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"+dependencies = [+ "proc-macro2",+ "quote",+ "unicode-ident",+]++[[package]]+name = "syn"+version = "3.0.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"+dependencies = [+ "proc-macro2",+ "quote",+ "unicode-ident",+]++[[package]]+name = "sync_wrapper"+version = "1.0.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"+dependencies = [+ "futures-core",+]++[[package]]+name = "synstructure"+version = "0.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "sys-locale"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4"+dependencies = [+ "libc",+]++[[package]]+name = "sysinfo"+version = "0.31.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be"+dependencies = [+ "core-foundation-sys",+ "libc",+ "memchr",+ "ntapi",+ "rayon",+ "windows 0.57.0",+]++[[package]]+name = "system-configuration"+version = "0.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"+dependencies = [+ "bitflags 2.13.2",+ "core-foundation 0.9.4",+ "system-configuration-sys",+]++[[package]]+name = "system-configuration-sys"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"+dependencies = [+ "core-foundation-sys",+ "libc",+]++[[package]]+name = "taffy"+version = "0.15.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "31f7bd2d97198df05186f93a3a3c306845f40e8b3c22bf9279cdd7e5cf5fea7d"+dependencies = [+ "serde",+ "slotmap",+ "smallvec",+]++[[package]]+name = "tao-core-video-sys"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "271450eb289cb4d8d0720c6ce70c72c8c858c93dd61fc625881616752e6b98f6"+dependencies = [+ "cfg-if",+ "core-foundation-sys",+ "libc",+ "objc",+]++[[package]]+name = "tauri-winrt-notification"+version = "0.7.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9ed071c670382e85fc2f48ae706492d8c338f4f89bf72520d32f8abfe880aade"+dependencies = [+ "thiserror 2.0.21",+ "windows 0.61.3",+ "windows-version",+]++[[package]]+name = "tempfile"+version = "3.27.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"+dependencies = [+ "fastrand",+ "getrandom 0.4.3",+ "once_cell",+ "rustix",+ "windows-sys 0.61.2",+]++[[package]]+name = "tendril"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0"+dependencies = [+ "futf",+ "mac",+ "utf-8",+]++[[package]]+name = "termcolor"+version = "1.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"+dependencies = [+ "winapi-util",+]++[[package]]+name = "thiserror"+version = "1.0.69"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"+dependencies = [+ "thiserror-impl 1.0.69",+]++[[package]]+name = "thiserror"+version = "2.0.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"+dependencies = [+ "thiserror-impl 2.0.21",+]++[[package]]+name = "thiserror-impl"+version = "1.0.69"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "thiserror-impl"+version = "2.0.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "tiff"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52"+dependencies = [+ "fax",+ "flate2",+ "half",+ "quick-error 2.0.1",+ "weezl",+ "zune-jpeg 0.5.15",+]++[[package]]+name = "time"+version = "0.3.55"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134"+dependencies = [+ "deranged",+ "num-conv",+ "powerfmt",+ "serde_core",+ "time-core",+]++[[package]]+name = "time-core"+version = "0.1.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"++[[package]]+name = "tiny-skia"+version = "0.11.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab"+dependencies = [+ "arrayref",+ "arrayvec",+ "bytemuck",+ "cfg-if",+ "log",+ "png 0.17.16",+ "tiny-skia-path",+]++[[package]]+name = "tiny-skia-path"+version = "0.11.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93"+dependencies = [+ "arrayref",+ "bytemuck",+ "strict-num",+]++[[package]]+name = "tinystr"+version = "0.8.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a"+dependencies = [+ "displaydoc",+ "serde_core",+ "zerovec",+]++[[package]]+name = "tinytemplate"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc"+dependencies = [+ "serde",+ "serde_json",+]++[[package]]+name = "tinyvec"+version = "1.13.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"++[[package]]+name = "tokio"+version = "1.54.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"+dependencies = [+ "bytes",+ "libc",+ "mio",+ "pin-project-lite",+ "socket2",+ "windows-sys 0.61.2",+]++[[package]]+name = "tokio-rustls"+version = "0.26.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db"+dependencies = [+ "rustls",+ "tokio",+]++[[package]]+name = "tokio-socks"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a7e2948f60dbe26b35f2c7fb74ac2854c1fddded0fe9d7548fcc674a246f7615"+dependencies = [+ "either",+ "futures-util",+ "thiserror 1.0.69",+ "tokio",+]++[[package]]+name = "tokio-util"+version = "0.7.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b"+dependencies = [+ "bytes",+ "futures-core",+ "futures-sink",+ "libc",+ "pin-project-lite",+ "tokio",+]++[[package]]+name = "toml"+version = "0.8.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"+dependencies = [+ "serde",+ "serde_spanned 0.6.9",+ "toml_datetime 0.6.11",+ "toml_edit 0.22.27",+]++[[package]]+name = "toml"+version = "1.2.0+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c5ffcdf8f50436dbbfd675c1fe1b8e0854f42b7defea8584bdebe1aee900e561"+dependencies = [+ "indexmap",+ "serde_core",+ "serde_spanned 1.1.2",+ "toml_datetime 1.1.2+spec-1.1.0",+ "toml_parser",+ "toml_writer",+ "winnow 1.0.5",+]++[[package]]+name = "toml_datetime"+version = "0.6.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"+dependencies = [+ "serde",+]++[[package]]+name = "toml_datetime"+version = "1.1.2+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053"+dependencies = [+ "serde_core",+]++[[package]]+name = "toml_edit"+version = "0.22.27"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"+dependencies = [+ "indexmap",+ "serde",+ "serde_spanned 0.6.9",+ "toml_datetime 0.6.11",+ "toml_write",+ "winnow 0.7.15",+]++[[package]]+name = "toml_edit"+version = "0.25.18+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1ec6e78bd70db9420d8d212fa9dc97f116448a1ceff5d00eabb991d407e21396"+dependencies = [+ "indexmap",+ "toml_datetime 1.1.2+spec-1.1.0",+ "toml_parser",+ "winnow 1.0.5",+]++[[package]]+name = "toml_parser"+version = "1.1.5+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c"+dependencies = [+ "winnow 1.0.5",+]++[[package]]+name = "toml_write"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"++[[package]]+name = "toml_writer"+version = "1.2.0+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "009dbb7700f11c55ef83aebbe4c0e9cf1f1ac0844bd8d6f00dc38f302026e13a"++[[package]]+name = "tower"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"+dependencies = [+ "futures-core",+ "futures-util",+ "pin-project-lite",+ "sync_wrapper",+ "tokio",+ "tower-layer",+ "tower-service",+]++[[package]]+name = "tower-layer"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"++[[package]]+name = "tower-service"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"++[[package]]+name = "tracing"+version = "0.1.44"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"+dependencies = [+ "log",+ "pin-project-lite",+ "tracing-attributes",+ "tracing-core",+]++[[package]]+name = "tracing-attributes"+version = "0.1.31"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "tracing-core"+version = "0.1.36"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"+dependencies = [+ "once_cell",+]++[[package]]+name = "triomphe"+version = "0.1.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d15f4f5898bcfc5d8a8e45ed30b2f108d710c1a2e5489dbf80e078f707181bc"+dependencies = [+ "arc-swap",+ "serde",+ "stable_deref_trait",+]++[[package]]+name = "try-lock"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"++[[package]]+name = "ttf-parser"+version = "0.25.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31"+dependencies = [+ "core_maths",+]++[[package]]+name = "typenum"+version = "1.20.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"++[[package]]+name = "uds_windows"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"+dependencies = [+ "memoffset",+ "tempfile",+ "windows-sys 0.61.2",+]++[[package]]+name = "unarray"+version = "0.1.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94"++[[package]]+name = "unicase"+version = "2.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f"++[[package]]+name = "unicode-bidi"+version = "0.3.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"++[[package]]+name = "unicode-bidi-mirroring"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5dfa6e8c60bb66d49db113e0125ee8711b7647b5579dc7f5f19c42357ed039fe"++[[package]]+name = "unicode-ccc"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e"++[[package]]+name = "unicode-id"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65dd75ab2d9d379dbe86d4059e91d8b5a6e7054865eaba1ddbfc7a817ff96392"++[[package]]+name = "unicode-ident"+version = "1.0.27"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"++[[package]]+name = "unicode-linebreak"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"++[[package]]+name = "unicode-properties"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "993ad287eb20e8ba755312801cfe1413e0f25d604075863acaddca10b04c1833"++[[package]]+name = "unicode-script"+version = "0.5.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aa04c955db05429d464c74d495c1ee677e1866e783a4c3747f9c0cef7756cabf"++[[package]]+name = "unicode-segmentation"+version = "1.13.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"++[[package]]+name = "unicode-vo"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94"++[[package]]+name = "unicode-width"+version = "0.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557"++[[package]]+name = "untrusted"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"++[[package]]+name = "url"+version = "2.5.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"+dependencies = [+ "form_urlencoded",+ "idna",+ "percent-encoding",+ "serde",+]++[[package]]+name = "usvg"+version = "0.45.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "80be9b06fbae3b8b303400ab20778c80bbaf338f563afe567cf3c9eea17b47ef"+dependencies = [+ "base64 0.22.1",+ "data-url",+ "flate2",+ "fontdb",+ "imagesize 0.13.0",+ "kurbo 0.11.3",+ "log",+ "pico-args",+ "roxmltree 0.20.0",+ "rustybuzz",+ "simplecss",+ "siphasher",+ "strict-num",+ "svgtypes 0.15.3",+ "tiny-skia-path",+ "unicode-bidi",+ "unicode-script",+ "unicode-vo",+ "xmlwriter",+]++[[package]]+name = "usvg"+version = "0.46.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e419dff010bb12512b0ae9e3d2f318dfbdf0167fde7eb05465134d4e8756076f"+dependencies = [+ "base64 0.22.1",+ "data-url",+ "flate2",+ "fontdb",+ "imagesize 0.14.0",+ "kurbo 0.13.1",+ "log",+ "pico-args",+ "roxmltree 0.21.2",+ "rustybuzz",+ "simplecss",+ "siphasher",+ "strict-num",+ "svgtypes 0.16.2",+ "tiny-skia-path",+ "unicode-bidi",+ "unicode-script",+ "unicode-vo",+ "xmlwriter",+]++[[package]]+name = "utf-8"+version = "0.7.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"++[[package]]+name = "utf8_iter"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0"+dependencies = [+ "utf_types",+]++[[package]]+name = "utf_types"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6"++[[package]]+name = "uuid"+version = "1.26.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce"+dependencies = [+ "getrandom 0.4.3",+ "js-sys",+ "serde_core",+ "sha1_smol",+ "wasm-bindgen",+]++[[package]]+name = "v_frame"+version = "0.3.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2"+dependencies = [+ "aligned-vec",+ "num-traits",+ "wasm-bindgen",+]++[[package]]+name = "version_check"+version = "0.9.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"++[[package]]+name = "vswhom"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b"+dependencies = [+ "libc",+ "vswhom-sys",+]++[[package]]+name = "vswhom-sys"+version = "0.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150"+dependencies = [+ "cc",+ "libc",+]++[[package]]+name = "wait-timeout"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11"+dependencies = [+ "libc",+]++[[package]]+name = "waker-fn"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7"++[[package]]+name = "walkdir"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"+dependencies = [+ "same-file",+ "winapi-util",+]++[[package]]+name = "want"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec4cdd0dd910afe868b7ef477227d8d538b46b3075031afee8a9f2acb0a2ed0b"+dependencies = [+ "try-lock",+]++[[package]]+name = "wasi"+version = "0.11.1+wasi-snapshot-preview1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"++[[package]]+name = "wasip2"+version = "1.0.4+wasi-0.2.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487"+dependencies = [+ "wit-bindgen",+]++[[package]]+name = "wasm-bindgen"+version = "0.2.130"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c"+dependencies = [+ "cfg-if",+ "rustversion",+ "wasm-bindgen-macro",+ "wasm-bindgen-shared",+]++[[package]]+name = "wasm-bindgen-futures"+version = "0.4.80"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5e14e0327cb5368ad60ccb22d04a9827a693c95a926d8d125e9fa39e0baec501"+dependencies = [+ "js-sys",+ "tokio",+ "wasm-bindgen",+]++[[package]]+name = "wasm-bindgen-macro"+version = "0.2.130"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9"+dependencies = [+ "quote",+ "wasm-bindgen-macro-support",+]++[[package]]+name = "wasm-bindgen-macro-support"+version = "0.2.130"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a"+dependencies = [+ "bumpalo",+ "proc-macro2",+ "quote",+ "syn 3.0.9",+ "wasm-bindgen-shared",+]++[[package]]+name = "wasm-bindgen-shared"+version = "0.2.130"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e"+dependencies = [+ "unicode-ident",+]++[[package]]+name = "wasm-streams"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65"+dependencies = [+ "futures-util",+ "js-sys",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "web-sys",+]++[[package]]+name = "wasm_thread"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b7516db7f32decdadb1c3b8deb1b7d78b9df7606c5cc2f6241737c2ab3a0258e"+dependencies = [+ "futures",+ "js-sys",+ "wasm-bindgen",+ "web-sys",+]++[[package]]+name = "wayland-sys"+version = "0.31.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d8eab23fefc9e41f8e841df4a9c707e8a8c4ed26e944ef69297184de2785e3be"+dependencies = [+ "dlib",+ "log",+ "once_cell",+ "pkg-config",+]++[[package]]+name = "web-sys"+version = "0.3.107"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d7d179596ff5ec0f6de4db64d54011bde6289cc49603d3a6e4ce3f329207ab88"+dependencies = [+ "js-sys",+ "wasm-bindgen",+]++[[package]]+name = "web-time"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"+dependencies = [+ "js-sys",+ "wasm-bindgen",+]++[[package]]+name = "weezl"+version = "0.1.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"++[[package]]+name = "wgpu"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "527ccdf43dd5b2e8676eed9984ce00e2bbb0a1b85b70c1969dcb6cd2eb55ab9e"+dependencies = [+ "arrayvec",+ "bitflags 2.13.2",+ "bytemuck",+ "cfg-if",+ "cfg_aliases",+ "document-features",+ "hashbrown 0.17.1",+ "js-sys",+ "log",+ "naga",+ "parking_lot",+ "portable-atomic",+ "profiling",+ "raw-window-handle",+ "smallvec",+ "static_assertions",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "web-sys",+ "wgpu-core",+ "wgpu-hal",+ "wgpu-types",+]++[[package]]+name = "wgpu-core"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "14c018fce9b6270aa203c2fdd56f3cce996713534bd757e4ea58c8560b121f14"+dependencies = [+ "arrayvec",+ "bit-set 0.10.0",+ "bit-vec 0.9.1",+ "bitflags 2.13.2",+ "bytemuck",+ "cfg_aliases",+ "document-features",+ "hashbrown 0.17.1",+ "indexmap",+ "log",+ "naga",+ "naga-types",+ "once_cell",+ "parking_lot",+ "portable-atomic",+ "profiling",+ "raw-window-handle",+ "rustc-hash 1.1.0",+ "smallvec",+ "thiserror 2.0.21",+ "wgpu-core-deps-apple",+ "wgpu-core-deps-emscripten",+ "wgpu-core-deps-wasm",+ "wgpu-core-deps-windows-linux-android",+ "wgpu-hal",+ "wgpu-naga-bridge",+ "wgpu-types",+]++[[package]]+name = "wgpu-core-deps-apple"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "061f3d319a40d39d00b1ecc2c33b89fe21d4e6fe01859df3500a3a8ecccd6b68"+dependencies = [+ "wgpu-hal",+]++[[package]]+name = "wgpu-core-deps-emscripten"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d98b86cf4abf524a902dd35f18ca6a3f08fc2ae9847c8f10b48e30491b1f0b86"+dependencies = [+ "wgpu-hal",+]++[[package]]+name = "wgpu-core-deps-wasm"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d260ca2ca8adc654f513a869bf3cac0b47f5b8d3f87803d6942015f8de597aae"+dependencies = [+ "wgpu-hal",+]++[[package]]+name = "wgpu-core-deps-windows-linux-android"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7586165fd5f6d881cb9ce4bb71f40d6caab2c0f1837e3fc1d9788a197fb6004f"+dependencies = [+ "wgpu-hal",+]++[[package]]+name = "wgpu-hal"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6b7fb58561a792bc237628ba0792e332de418fefe145f13b5ed8201e6d52f58"+dependencies = [+ "android_system_properties",+ "arrayvec",+ "ash",+ "bit-set 0.10.0",+ "bitflags 2.13.2",+ "block2 0.6.2",+ "bytemuck",+ "cfg-if",+ "cfg_aliases",+ "glow",+ "glutin_wgl_sys",+ "gpu-allocator",+ "hashbrown 0.17.1",+ "js-sys",+ "khronos-egl",+ "libc",+ "libloading",+ "log",+ "naga",+ "naga-types",+ "ndk-sys",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-core-graphics",+ "objc2-foundation 0.3.2",+ "objc2-metal 0.3.2",+ "objc2-quartz-core 0.3.2",+ "once_cell",+ "ordered-float",+ "parking_lot",+ "portable-atomic",+ "portable-atomic-util",+ "profiling",+ "range-alloc",+ "raw-window-handle",+ "raw-window-metal",+ "renderdoc-sys",+ "smallvec",+ "static_assertions",+ "thiserror 2.0.21",+ "wasm-bindgen",+ "wayland-sys",+ "web-sys",+ "wgpu-naga-bridge",+ "wgpu-types",+ "windows 0.62.2",+ "windows-core 0.62.2",+ "windows-result 0.4.1",+]++[[package]]+name = "wgpu-naga-bridge"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d2f62e73117bb7a62bfd9c5a5841438a823f6566c6442a808ee269d2d055c081"+dependencies = [+ "naga",+ "wgpu-types",+]++[[package]]+name = "wgpu-types"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "99dad6f1fbdbbdb4c278a6508b059d44688f5cebddf78d005a46a31340269286"+dependencies = [+ "bitflags 2.13.2",+ "bytemuck",+ "js-sys",+ "log",+ "naga-types",+ "raw-window-handle",+ "static_assertions",+ "web-sys",+]++[[package]]+name = "which"+version = "8.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bae2f2b2b816647a1cab1acc91f5bd20812d53cb344382635ec2181940c8034f"+dependencies = [+ "libc",+]++[[package]]+name = "winapi"+version = "0.3.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"+dependencies = [+ "winapi-i686-pc-windows-gnu",+ "winapi-x86_64-pc-windows-gnu",+]++[[package]]+name = "winapi-i686-pc-windows-gnu"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"++[[package]]+name = "winapi-util"+version = "0.1.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"+dependencies = [+ "windows-sys 0.61.2",+]++[[package]]+name = "winapi-x86_64-pc-windows-gnu"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"++[[package]]+name = "windows"+version = "0.57.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143"+dependencies = [+ "windows-core 0.57.0",+ "windows-targets 0.52.6",+]++[[package]]+name = "windows"+version = "0.58.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6"+dependencies = [+ "windows-core 0.58.0",+ "windows-targets 0.52.6",+]++[[package]]+name = "windows"+version = "0.61.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"+dependencies = [+ "windows-collections 0.2.0",+ "windows-core 0.61.2",+ "windows-future 0.2.1",+ "windows-link 0.1.3",+ "windows-numerics 0.2.0",+]++[[package]]+name = "windows"+version = "0.62.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"+dependencies = [+ "windows-collections 0.3.2",+ "windows-core 0.62.2",+ "windows-future 0.3.2",+ "windows-numerics 0.3.1",+]++[[package]]+name = "windows-capture"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3a4df73e95feddb9ec1a7e9c2ca6323b8c97d5eeeff78d28f1eccdf19c882b24"+dependencies = [+ "parking_lot",+ "rayon",+ "thiserror 2.0.21",+ "windows 0.61.3",+ "windows-future 0.2.1",+]++[[package]]+name = "windows-collections"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"+dependencies = [+ "windows-core 0.61.2",+]++[[package]]+name = "windows-collections"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"+dependencies = [+ "windows-core 0.62.2",+]++[[package]]+name = "windows-core"+version = "0.57.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d"+dependencies = [+ "windows-implement 0.57.0",+ "windows-interface 0.57.0",+ "windows-result 0.1.2",+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-core"+version = "0.58.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99"+dependencies = [+ "windows-implement 0.58.0",+ "windows-interface 0.58.0",+ "windows-result 0.2.0",+ "windows-strings 0.1.0",+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-core"+version = "0.61.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"+dependencies = [+ "windows-implement 0.60.2",+ "windows-interface 0.59.3",+ "windows-link 0.1.3",+ "windows-result 0.3.4",+ "windows-strings 0.4.2",+]++[[package]]+name = "windows-core"+version = "0.62.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"+dependencies = [+ "windows-implement 0.60.2",+ "windows-interface 0.59.3",+ "windows-link 0.2.1",+ "windows-result 0.4.1",+ "windows-strings 0.5.1",+]++[[package]]+name = "windows-future"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"+dependencies = [+ "windows-core 0.61.2",+ "windows-link 0.1.3",+ "windows-threading 0.1.0",+]++[[package]]+name = "windows-future"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"+dependencies = [+ "windows-core 0.62.2",+ "windows-link 0.2.1",+ "windows-threading 0.2.1",+]++[[package]]+name = "windows-implement"+version = "0.57.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-implement"+version = "0.58.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-implement"+version = "0.60.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-interface"+version = "0.57.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-interface"+version = "0.58.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-interface"+version = "0.59.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-link"+version = "0.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"++[[package]]+name = "windows-link"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"++[[package]]+name = "windows-numerics"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"+dependencies = [+ "windows-core 0.61.2",+ "windows-link 0.1.3",+]++[[package]]+name = "windows-numerics"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"+dependencies = [+ "windows-core 0.62.2",+ "windows-link 0.2.1",+]++[[package]]+name = "windows-registry"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3"+dependencies = [+ "windows-result 0.3.4",+ "windows-strings 0.3.1",+ "windows-targets 0.53.5",+]++[[package]]+name = "windows-registry"+version = "0.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"+dependencies = [+ "windows-link 0.2.1",+ "windows-result 0.4.1",+ "windows-strings 0.5.1",+]++[[package]]+name = "windows-result"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"+dependencies = [+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-result"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e"+dependencies = [+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-result"+version = "0.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"+dependencies = [+ "windows-link 0.1.3",+]++[[package]]+name = "windows-result"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"+dependencies = [+ "windows-link 0.2.1",+]++[[package]]+name = "windows-strings"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10"+dependencies = [+ "windows-result 0.2.0",+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-strings"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319"+dependencies = [+ "windows-link 0.1.3",+]++[[package]]+name = "windows-strings"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"+dependencies = [+ "windows-link 0.1.3",+]++[[package]]+name = "windows-strings"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"+dependencies = [+ "windows-link 0.2.1",+]++[[package]]+name = "windows-sys"+version = "0.48.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"+dependencies = [+ "windows-targets 0.48.5",+]++[[package]]+name = "windows-sys"+version = "0.52.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"+dependencies = [+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-sys"+version = "0.61.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"+dependencies = [+ "windows-link 0.2.1",+]++[[package]]+name = "windows-targets"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"+dependencies = [+ "windows_aarch64_gnullvm 0.48.5",+ "windows_aarch64_msvc 0.48.5",+ "windows_i686_gnu 0.48.5",+ "windows_i686_msvc 0.48.5",+ "windows_x86_64_gnu 0.48.5",+ "windows_x86_64_gnullvm 0.48.5",+ "windows_x86_64_msvc 0.48.5",+]++[[package]]+name = "windows-targets"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"+dependencies = [+ "windows_aarch64_gnullvm 0.52.6",+ "windows_aarch64_msvc 0.52.6",+ "windows_i686_gnu 0.52.6",+ "windows_i686_gnullvm 0.52.6",+ "windows_i686_msvc 0.52.6",+ "windows_x86_64_gnu 0.52.6",+ "windows_x86_64_gnullvm 0.52.6",+ "windows_x86_64_msvc 0.52.6",+]++[[package]]+name = "windows-targets"+version = "0.53.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"+dependencies = [+ "windows-link 0.2.1",+ "windows_aarch64_gnullvm 0.53.1",+ "windows_aarch64_msvc 0.53.1",+ "windows_i686_gnu 0.53.1",+ "windows_i686_gnullvm 0.53.1",+ "windows_i686_msvc 0.53.1",+ "windows_x86_64_gnu 0.53.1",+ "windows_x86_64_gnullvm 0.53.1",+ "windows_x86_64_msvc 0.53.1",+]++[[package]]+name = "windows-threading"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"+dependencies = [+ "windows-link 0.1.3",+]++[[package]]+name = "windows-threading"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"+dependencies = [+ "windows-link 0.2.1",+]++[[package]]+name = "windows-version"+version = "0.1.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631"+dependencies = [+ "windows-link 0.2.1",+]++[[package]]+name = "windows_aarch64_gnullvm"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"++[[package]]+name = "windows_aarch64_gnullvm"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"++[[package]]+name = "windows_aarch64_gnullvm"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"++[[package]]+name = "windows_aarch64_msvc"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"++[[package]]+name = "windows_aarch64_msvc"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"++[[package]]+name = "windows_aarch64_msvc"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"++[[package]]+name = "windows_i686_gnu"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"++[[package]]+name = "windows_i686_gnu"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"++[[package]]+name = "windows_i686_gnu"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"++[[package]]+name = "windows_i686_gnullvm"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"++[[package]]+name = "windows_i686_gnullvm"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"++[[package]]+name = "windows_i686_msvc"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"++[[package]]+name = "windows_i686_msvc"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"++[[package]]+name = "windows_i686_msvc"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"++[[package]]+name = "windows_x86_64_gnu"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"++[[package]]+name = "windows_x86_64_gnu"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"++[[package]]+name = "windows_x86_64_gnu"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"++[[package]]+name = "windows_x86_64_gnullvm"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"++[[package]]+name = "windows_x86_64_gnullvm"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"++[[package]]+name = "windows_x86_64_gnullvm"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"++[[package]]+name = "windows_x86_64_msvc"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"++[[package]]+name = "windows_x86_64_msvc"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"++[[package]]+name = "windows_x86_64_msvc"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"++[[package]]+name = "winnow"+version = "0.7.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"+dependencies = [+ "memchr",+]++[[package]]+name = "winnow"+version = "1.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8c3b93199df0ab874cdf0c6a94f0a0dc3423fe41f1cafb62b8bd7b1deb277aef"+dependencies = [+ "memchr",+]++[[package]]+name = "winreg"+version = "0.56.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10"+dependencies = [+ "cfg-if",+ "windows-sys 0.61.2",+]++[[package]]+name = "wio"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5"+dependencies = [+ "winapi",+]++[[package]]+name = "wit-bindgen"+version = "0.57.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"++[[package]]+name = "writeable"+version = "0.6.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"++[[package]]+name = "x11"+version = "2.21.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e"+dependencies = [+ "libc",+ "pkg-config",+]++[[package]]+name = "xcb"+version = "1.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a6c2ad15e0e922856ee89afe862b8992334bbe7953adad56cd1199358cb30566"+dependencies = [+ "bitflags 2.13.2",+ "libc",+ "quick-xml",+ "x11",+]++[[package]]+name = "xml-rs"+version = "0.8.29"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7"++[[package]]+name = "xml5ever"+version = "0.18.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9bbb26405d8e919bc1547a5aa9abc95cbfa438f04844f5fdd9dc7596b748bf69"+dependencies = [+ "log",+ "mac",+ "markup5ever",+]++[[package]]+name = "xmlwriter"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"++[[package]]+name = "y4m"+version = "0.8.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448"++[[package]]+name = "yazi"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ac366ea532fa8ee6a992cec9dea525b1dc284e69702f36c2ab5fbebadc81ec86"++[[package]]+name = "yeslogic-fontconfig-sys"+version = "6.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1d8b8abf912b9a29ff112e1671c97c33636903d13a69712037190e6805af4f76"+dependencies = [+ "dlib",+ "once_cell",+ "pkg-config",+]++[[package]]+name = "yoke"+version = "0.8.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3"+dependencies = [+ "stable_deref_trait",+ "yoke-derive",+ "zerofrom",+]++[[package]]+name = "yoke-derive"+version = "0.8.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+ "synstructure",+]++[[package]]+name = "zbus"+version = "5.19.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907"+dependencies = [+ "async-broadcast",+ "async-executor",+ "async-io",+ "async-lock",+ "async-process",+ "async-recursion",+ "async-task",+ "async-trait",+ "blocking",+ "enumflags2",+ "event-listener",+ "futures-core",+ "futures-lite",+ "hex",+ "libc",+ "ordered-stream",+ "rustix",+ "serde",+ "serde_repr",+ "tracing",+ "uds_windows",+ "uuid",+ "windows-sys 0.61.2",+ "winnow 1.0.5",+ "zbus_macros",+ "zbus_names",+ "zvariant",+]++[[package]]+name = "zbus_macros"+version = "5.19.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40"+dependencies = [+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 3.0.9",+ "zbus_names",+ "zvariant",+ "zvariant_utils",+]++[[package]]+name = "zbus_names"+version = "4.3.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd"+dependencies = [+ "serde",+ "winnow 1.0.5",+ "zvariant",+]++[[package]]+name = "zcheapstr"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "939f186d9ecebe044315a5cb6d6f78568bbc21152adc954d5a0c2f58bdbc9920"+dependencies = [+ "serde",+]++[[package]]+name = "zed-font-kit"+version = "0.14.1-zed"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a3898e450f36f852edda72e3f985c34426042c4951790b23b107f93394f9bff5"+dependencies = [+ "bitflags 2.13.2",+ "byteorder",+ "core-foundation 0.10.1",+ "core-graphics 0.24.0",+ "core-text",+ "dirs 5.0.1",+ "dwrote",+ "float-ord",+ "freetype-sys",+ "lazy_static",+ "libc",+ "log",+ "pathfinder_geometry",+ "pathfinder_simd",+ "walkdir",+ "winapi",+ "yeslogic-fontconfig-sys",+]++[[package]]+name = "zed-scap"+version = "0.0.8-zed"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6b338d705ae33a43ca00287c11129303a7a0aa57b101b72a1c08c863f698ac8"+dependencies = [+ "anyhow",+ "cocoa",+ "core-graphics-helmer-fork",+ "log",+ "objc",+ "rand 0.8.8",+ "screencapturekit",+ "screencapturekit-sys",+ "sysinfo",+ "tao-core-video-sys",+ "windows 0.61.3",+ "windows-capture",+ "x11",+ "xcb",+]++[[package]]+name = "zeno"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524"++[[package]]+name = "zerocopy"+version = "0.8.63"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8"+dependencies = [+ "zerocopy-derive",+]++[[package]]+name = "zerocopy-derive"+version = "0.8.63"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "zerofrom"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"+dependencies = [+ "zerofrom-derive",+]++[[package]]+name = "zerofrom-derive"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+ "synstructure",+]++[[package]]+name = "zeroize"+version = "1.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879"+dependencies = [+ "zeroize_derive",+]++[[package]]+name = "zeroize_derive"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "zerotrie"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"+dependencies = [+ "displaydoc",+ "yoke",+ "zerofrom",+ "zerovec",+]++[[package]]+name = "zerovec"+version = "0.11.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40"+dependencies = [+ "serde",+ "yoke",+ "zerofrom",+ "zerovec-derive",+]++[[package]]+name = "zerovec-derive"+version = "0.11.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "zlib-rs"+version = "0.6.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112"++[[package]]+name = "zmij"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"++[[package]]+name = "zune-core"+version = "0.4.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a"++[[package]]+name = "zune-core"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b"++[[package]]+name = "zune-inflate"+version = "0.2.54"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02"+dependencies = [+ "simd-adler32",+]++[[package]]+name = "zune-jpeg"+version = "0.4.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713"+dependencies = [+ "zune-core 0.4.12",+]++[[package]]+name = "zune-jpeg"+version = "0.5.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"+dependencies = [+ "zune-core 0.5.3",+]++[[package]]+name = "zvariant"+version = "5.15.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7"+dependencies = [+ "endi",+ "enumflags2",+ "serde",+ "serde_bytes",+ "winnow 1.0.5",+ "zcheapstr",+ "zvariant_derive",+ "zvariant_utils",+]++[[package]]+name = "zvariant_derive"+version = "5.15.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d"+dependencies = [+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 3.0.9",+ "zvariant_utils",+]++[[package]]+name = "zvariant_utils"+version = "4.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3"+dependencies = [+ "proc-macro2",+ "quote",+ "serde",+ "syn 3.0.9",+ "winnow 1.0.5",+]diff --git a/bindings/rust/blenderui-table-gpui/Cargo.toml b/bindings/rust/blenderui-table-gpui/Cargo.tomlnew file mode 100644index 0000000..4bb2d01--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/Cargo.toml@@ -0,0 +1,81 @@+[package]+name = "blenderui-table-gpui"+description = "A gpui-component-style DataTable for gpui that paints only the visible cells, on the shared blenderui-table core"+version = "0.2.0"+edition = "2024"+license = "GPL-2.0-or-later"+repository = "https://github.com/ppmpreetham/BUI"+homepage = "https://bui.preetham.top"+authors = ["BUI contributors"]+rust-version = "1.88"+documentation = "https://docs.rs/blenderui-table-gpui"+keywords = ["gpui", "table", "datagrid", "virtualization", "blender"]+categories = ["gui"]+readme = "README.md"+include = ["src/**", "examples/**", "README.md", "Cargo.toml"]+# not published yet; also kept out of the main workspace (gpui is a huge build)+publish = false++# its own workspace: like `bench/`, it never enters the normal CI builds+[workspace]++[dependencies]+blenderui-table = { path = "../blenderui-table", version = "0.2.0" }+blenderui-paint-gpui = { path = "../blenderui-paint-gpui", version = "0.2.0" }+gpui = { package = "gpui-pre", version = "=0.3.11" }++[dev-dependencies]+gpui = { package = "gpui-pre", version = "=0.3.11", features = ["test-support"] }++[features]+# The head-to-head benchmark against gpui-component 0.9.0 (a very large build).+bench = ["dep:gpui-component", "dep:gpui_platform", "dep:gpui-kit-assets"]++[dependencies.gpui-component]+version = "=0.9.0"+optional = true++[dependencies.gpui-kit-assets]+version = "=0.9.0"+optional = true++[dependencies.gpui_platform]+package = "gpui-pre-platform"+version = "=0.3.11"+optional = true++[[example]]+name = "bench_gpui"+path = "examples/bench_gpui.rs"+required-features = ["bench"]++[profile.release]+debug = false++[lints.clippy]+all = { level = "warn", priority = -2 }+pedantic = { level = "warn", priority = -2 }+perf = { level = "warn", priority = -1 }+complexity = { level = "warn", priority = -1 }+inline_always = "allow"+unseparated_literal_suffix = "allow"+similar_names = "allow"+missing_panics_doc = "allow"+missing_errors_doc = "allow"+absolute_paths = "allow"+module_name_repetitions = "allow"+doc_markdown = "allow"+too_many_lines = "allow"+unused_self = "allow"+cast_possible_truncation = "allow"+cast_sign_loss = "allow"+cast_precision_loss = "allow"+unreadable_literal = "allow"+implicit_hasher = "allow"+significant_drop_tightening = "warn"+redundant_clone = "warn"+use_self = "warn"+redundant_else = "warn"+or_fun_call = "warn"+missing_const_for_fn = "warn"+derive_partial_eq_without_eq = "warn"diff --git a/bindings/rust/blenderui-table-gpui/README.md b/bindings/rust/blenderui-table-gpui/README.mdnew file mode 100644index 0000000..9487d43--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/README.md@@ -0,0 +1,93 @@+# blenderui-table-gpui++A `DataTable` for [gpui](https://gpui.rs) with the API of gpui-component's,+built on the shared [`blenderui-table`](../blenderui-table) core. It paints+only the visible cells, straight into the window's scene, instead of building+an element per cell.++```rust+use blenderui_table_gpui::*;++struct People;++impl CellSource for People {+ fn cell(&self, row: usize, col: usize) -> Cell<'_> {+ match col {+ 0 => Cell::U64(row as u64),+ 1 => Cell::Str(["Cube", "Sphere", "Torus"][row % 3]),+ _ => Cell::F64(row as f64 / 8.0, 2),+ }+ }+}++impl TableDelegate for People {+ fn columns_count(&self, _: &App) -> usize { 3 }+ fn rows_count(&self, _: &App) -> usize { 1_000_000 }+ fn column(&self, ix: usize, _: &App) -> Column {+ Column::new(format!("c{ix}"), ["ID", "Name", "Size"][ix]).sortable().width(px(110.0))+ }+}++let table = cx.new(|cx| TableState::new(People, window, cx));+// in render+div().size_full().child(DataTable::new(&table).stripe(true).on_select(|row, _, _| println!("{row}")))+```++Names follow gpui-component: `TableDelegate` (`columns_count`, `rows_count`,+`column`, `perform_sort`, `fit_column`, `move_column`, `group_headers`,+`loading`, `has_more`, `load_more`, `visible_rows_changed` ...), `Column`,+`ColumnSort`, `ColumnGroup`, `TableState` (`selected_row`, `set_selected_row`,+`visible_range`, `scroll_to_row`, `scroll_to_col`, `col_width`, `fit_col` ...),+`TableSelection`, `TableEvent`, `Size`, `DataTable` (`stripe`, `bordered`,+`header_row_height`, `scrollbar_visible`, `on_select` ...).++## What differs from gpui-component++* **Cells are values, not elements.** `CellSource::cell` returns a typed+ `Cell` (a borrowed `&str`, an integer, a float with its decimals); the table+ formats numbers into a stack buffer and paints the text. Where+ gpui-component's `render_td` builds an element for every visible cell on+ every frame, a frame here builds two elements in total.+* **Escape hatch for rich cells.** Return `true` from `has_custom_cells` and+ `is_custom_cell(row, col)` for the few cells that need real elements+ (buttons, badges), return `Cell::Empty` from `cell` for them, and build the+ element in `render_td`. Only visible custom cells are built.+* **The table sorts for you.** A header click builds a row index list (typed+ keys, parallel, stable) and the data is never reordered. To sort your own+ data in `perform_sort` instead, return `false` from `sort_by_mask`.+* **`CellSource` is `Sync`** (sorting reads cells from several threads).+* No built-in context menu popup or accessibility tree yet.++## How it is fast++The frame work is Blender's, in the shared core: O(visible) range math,+column culling by bisection, one quad per run of selected rows and per column+separator, numbers formatted without allocation, sorting by typed keys. The+gpui-specific parts are a `PaintSink` that calls `Window::paint_quad` and+paints shaped lines, and a cache of shaped lines keyed by `(text, color,+size)`, kept across frames so scrolling never reshapes a string it showed a+frame ago (it is cleared when the scale factor changes, and bounded to twice+the visible cells, 2,048 at least).++## Building++This crate is its own Cargo workspace, outside the main one, because gpui is a+very large build. On Windows gpui needs `fxc.exe`:++```text+set GPUI_FXC_PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\fxc.exe+cargo build --release -j 1+cargo test -j 1 # the adapter on gpui's test platform+```++## Benchmark against gpui-component 0.9.0++```text+cargo build --release --features bench --example bench_gpui -j 1+node bench/run.mjs # 3 runs per configuration, medians+```++See `bench/results.md` for the last run and the website's data-table page for+the method and the caveats.++License: GPL-2.0-or-later, like the rest of BUI.diff --git a/bindings/rust/blenderui-table-gpui/bench/results.json b/bindings/rust/blenderui-table-gpui/bench/results.jsonnew file mode 100644index 0000000..3612200--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/bench/results.json@@ -0,0 +1,157 @@+[+ {+ "lib": "ours",+ "rows": 1000000,+ "cols": 20,+ "runs": 3,+ "data_ms": 80,+ "first_frame_ms": 431,+ "scroll_frames": 481,+ "fps": 60.1,+ "frame_ms_mean": 1.44,+ "frame_ms_p50": 1.445,+ "frame_ms_p95": 1.768,+ "frame_ms_p99": 2.11,+ "frame_ms_max": 2.709,+ "cpu_ms_per_frame": 4.59,+ "main_allocs_per_frame": 258.6,+ "proc_allocs_per_frame": 258.6,+ "still_frame_ms_p50": 0.971,+ "still_cpu_ms_per_frame": 4.168,+ "still_main_allocs_per_frame": 136,+ "select_ms": 1.046,+ "key_ms": 1.628,+ "sort_numeric_ms": 36.6,+ "sort_string_ms": 37.9,+ "data_mb": 146.3,+ "ws_after_scroll_mb": 188.2,+ "ws_delta_mb": 41.9,+ "peak_ws_mb": 230.8,+ "private_mb": 207.4,+ "key_works": true+ },+ {+ "lib": "gpui-component",+ "rows": 1000000,+ "cols": 20,+ "runs": 3,+ "data_ms": 78,+ "first_frame_ms": 444.7,+ "scroll_frames": 481,+ "fps": 60,+ "frame_ms_mean": 5.119,+ "frame_ms_p50": 4.752,+ "frame_ms_p95": 8.992,+ "frame_ms_p99": 9.578,+ "frame_ms_max": 11.339,+ "cpu_ms_per_frame": 8.855,+ "main_allocs_per_frame": 7622.9,+ "proc_allocs_per_frame": 7622.9,+ "still_frame_ms_p50": 4.731,+ "still_cpu_ms_per_frame": 8.388,+ "still_main_allocs_per_frame": 7415.5,+ "select_ms": 5.267,+ "key_ms": 8.848,+ "sort_numeric_ms": 140.3,+ "sort_string_ms": 56.9,+ "data_mb": 146.2,+ "ws_after_scroll_mb": 188,+ "ws_delta_mb": 41.8,+ "peak_ws_mb": 192,+ "private_mb": 198.4,+ "key_works": true+ },+ {+ "lib": "blank (no table)",+ "rows": 1000000,+ "cols": 20,+ "runs": 3,+ "data_ms": 77,+ "first_frame_ms": 437.9,+ "scroll_frames": 481,+ "fps": 60.1,+ "frame_ms_mean": 0.163,+ "frame_ms_p50": 0.154,+ "frame_ms_p95": 0.26,+ "frame_ms_p99": 0.3,+ "frame_ms_max": 0.408,+ "cpu_ms_per_frame": 0.984,+ "main_allocs_per_frame": 102,+ "proc_allocs_per_frame": 102,+ "still_frame_ms_p50": 0.151,+ "still_cpu_ms_per_frame": 0.957,+ "still_main_allocs_per_frame": 102,+ "select_ms": 0.176,+ "key_ms": 0.443,+ "sort_numeric_ms": 0,+ "sort_string_ms": 0,+ "data_mb": 146.3,+ "ws_after_scroll_mb": 33.7,+ "ws_delta_mb": -112.5,+ "peak_ws_mb": 168.5,+ "private_mb": 35.3,+ "key_works": false+ },+ {+ "lib": "ours",+ "rows": 100000,+ "cols": 8,+ "runs": 3,+ "data_ms": 3,+ "first_frame_ms": 510.4,+ "scroll_frames": 481,+ "fps": 60,+ "frame_ms_mean": 1.241,+ "frame_ms_p50": 1.244,+ "frame_ms_p95": 1.528,+ "frame_ms_p99": 1.782,+ "frame_ms_max": 2.359,+ "cpu_ms_per_frame": 2.38,+ "main_allocs_per_frame": 222.1,+ "proc_allocs_per_frame": 222.1,+ "still_frame_ms_p50": 0.794,+ "still_cpu_ms_per_frame": 3.287,+ "still_main_allocs_per_frame": 136,+ "select_ms": 0.79,+ "key_ms": 1.482,+ "sort_numeric_ms": 4.2,+ "sort_string_ms": 6.8,+ "data_mb": 12.5,+ "ws_after_scroll_mb": 54.1,+ "ws_delta_mb": 41.6,+ "peak_ws_mb": 56.7,+ "private_mb": 60.7,+ "key_works": true+ },+ {+ "lib": "gpui-component",+ "rows": 100000,+ "cols": 8,+ "runs": 3,+ "data_ms": 4,+ "first_frame_ms": 510.7,+ "scroll_frames": 481,+ "fps": 60,+ "frame_ms_mean": 4.316,+ "frame_ms_p50": 4.021,+ "frame_ms_p95": 7.146,+ "frame_ms_p99": 7.909,+ "frame_ms_max": 8.513,+ "cpu_ms_per_frame": 5.893,+ "main_allocs_per_frame": 5507.1,+ "proc_allocs_per_frame": 5507.1,+ "still_frame_ms_p50": 3.855,+ "still_cpu_ms_per_frame": 6.847,+ "still_main_allocs_per_frame": 5363.5,+ "select_ms": 4.241,+ "key_ms": 7.589,+ "sort_numeric_ms": 8.6,+ "sort_string_ms": 3.9,+ "data_mb": 12.5,+ "ws_after_scroll_mb": 47.4,+ "ws_delta_mb": 34.9,+ "peak_ws_mb": 49.9,+ "private_mb": 52.7,+ "key_works": true+ }+]\ No newline at end of filediff --git a/bindings/rust/blenderui-table-gpui/bench/results.md b/bindings/rust/blenderui-table-gpui/bench/results.mdnew file mode 100644index 0000000..b780c7d--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/bench/results.md@@ -0,0 +1,7 @@+| Library | Rows x cols | First frame ms | Frame ms p50 | p95 | p99 | FPS | CPU ms/frame | Allocs/frame (UI thread) | Allocs/frame (process) | Repaint ms p50 | Repaint allocs/frame | Select ms | Key ms | Sort numeric ms | Sort string ms | RAM above data MB | Peak RAM MB |+|---|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|+| ours | 1,000,000 x 20 | 431.00 | 1.45 | 1.77 | 2.11 | 60.1 | 4.59 | 258.60 | 258.60 | 0.97 | 136.00 | 1.05 | 1.63 | 36.60 | 37.90 | 41.9 | 230.8 |+| gpui-component | 1,000,000 x 20 | 444.70 | 4.75 | 8.99 | 9.58 | 60.0 | 8.86 | 7622.90 | 7622.90 | 4.73 | 7415.50 | 5.27 | 8.85 | 140.30 | 56.90 | 41.8 | 192.0 |+| blank (no table) | 1,000,000 x 20 | 437.90 | 0.15 | 0.26 | 0.30 | 60.1 | 0.98 | 102.00 | 102.00 | 0.15 | 102.00 | 0.18 | 0.44 | 0.00 | 0.00 | -112.5 | 168.5 |+| ours | 100,000 x 8 | 510.40 | 1.24 | 1.53 | 1.78 | 60.0 | 2.38 | 222.10 | 222.10 | 0.79 | 136.00 | 0.79 | 1.48 | 4.20 | 6.80 | 41.6 | 56.7 |+| gpui-component | 100,000 x 8 | 510.70 | 4.02 | 7.15 | 7.91 | 60.0 | 5.89 | 5507.10 | 5507.10 | 3.85 | 5363.50 | 4.24 | 7.59 | 8.60 | 3.90 | 34.9 | 49.9 |diff --git a/bindings/rust/blenderui-table-gpui/bench/run.mjs b/bindings/rust/blenderui-table-gpui/bench/run.mjsnew file mode 100644index 0000000..2e2e956--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/bench/run.mjs@@ -0,0 +1,54 @@+// Runs the head-to-head (examples/bench_gpui.rs) several times per+// configuration and writes the medians to results.json and results.md.+//+// cargo build --release --features bench --example bench_gpui -j 1+// node bench/run.mjs [--reps 3] [--seconds 8]+//+// One process per run and per library; nothing else should be running.++import { spawnSync } from "node:child_process";+import { writeFileSync } from "node:fs";+import { dirname, join } from "node:path";+import { fileURLToPath } from "node:url";++const here = dirname(fileURLToPath(import.meta.url));+const exe = join(here, "..", "target", "release", "examples", process.platform === "win32" ? "bench_gpui.exe" : "bench_gpui");+const arg = (k, d) => { const i = process.argv.indexOf(k); return i > 0 ? process.argv[i + 1] : d; };+const reps = Number(arg("--reps", 3));+const seconds = arg("--seconds", "8");++const configs = [{ rows: 1_000_000, cols: 20 }, { rows: 100_000, cols: 8 }];+const only = (cfg, lib) => lib !== "blank" || cfg.rows === 1_000_000; // the framework baseline once+const libs = ["ours", "component", "blank"];+const median = (xs) => { const s = [...xs].sort((a, b) => a - b); return s[Math.floor((s.length - 1) / 2)]; };++const results = [];+for (const cfg of configs) {+ for (const lib of libs.filter((l) => only(cfg, l))) {+ const runs = [];+ for (let i = 0; i < reps; i++) {+ const r = spawnSync(exe, ["--lib", lib, "--rows", String(cfg.rows), "--cols", String(cfg.cols), "--seconds", seconds], { encoding: "utf8", timeout: 300_000 });+ const line = (r.stdout || "").split("\n").find((l) => l.startsWith("{"));+ if (!line) { console.error(`run failed: ${lib} ${cfg.rows}x${cfg.cols}`, r.stderr?.slice(-400)); continue; }+ runs.push(JSON.parse(line));+ console.error(`${lib} ${cfg.rows}x${cfg.cols} run ${i + 1}: p50 ${runs.at(-1).frame_ms_p50} ms`);+ }+ if (!runs.length) continue;+ const med = { lib: runs[0].lib, rows: cfg.rows, cols: cfg.cols, runs: runs.length };+ for (const k of Object.keys(runs[0])) if (typeof runs[0][k] === "number" && !(k in med)) med[k] = median(runs.map((r) => r[k]));+ med.key_works = runs.every((r) => r.key_works);+ results.push(med);+ }+}+writeFileSync(join(here, "results.json"), JSON.stringify(results, null, 2));++const cols = [+ ["first_frame_ms", "First frame ms"], ["frame_ms_p50", "Frame ms p50"], ["frame_ms_p95", "p95"], ["frame_ms_p99", "p99"],+ ["fps", "FPS"], ["cpu_ms_per_frame", "CPU ms/frame"], ["main_allocs_per_frame", "Allocs/frame (UI thread)"],+ ["proc_allocs_per_frame", "Allocs/frame (process)"], ["still_frame_ms_p50", "Repaint ms p50"], ["still_main_allocs_per_frame", "Repaint allocs/frame"], ["select_ms", "Select ms"], ["key_ms", "Key ms"],+ ["sort_numeric_ms", "Sort numeric ms"], ["sort_string_ms", "Sort string ms"], ["ws_delta_mb", "RAM above data MB"], ["peak_ws_mb", "Peak RAM MB"],+];+let md = `| Library | Rows x cols | ${cols.map((c) => c[1]).join(" | ")} |\n|---|---|${cols.map(() => "---:").join("|")}|\n`;+for (const r of results) md += `| ${r.lib} | ${r.rows.toLocaleString("en-US")} x ${r.cols} | ${cols.map(([k]) => (r[k] ?? 0).toFixed(k.includes("allocs") || k.includes("ms") ? 2 : 1)).join(" | ")} |\n`;+writeFileSync(join(here, "results.md"), md);+console.log(md);diff --git a/bindings/rust/blenderui-table-gpui/examples/bench_gpui.rs b/bindings/rust/blenderui-table-gpui/examples/bench_gpui.rsnew file mode 100644index 0000000..b4fee33--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/examples/bench_gpui.rs@@ -0,0 +1,554 @@+//! Head-to-head: this crate's `DataTable` vs gpui-component 0.9.0's `DataTable`,+//! on the same gpui (gpui-pre 0.3.11), the same data, in a real window.+//!+//! ```text+//! cargo build --release --features bench --example bench_gpui -j 1+//! node bench/run.mjs # 3 runs per configuration, medians, writes bench/results.*+//! target/release/examples/bench_gpui.exe --lib ours --rows 1000000 --cols 20+//! ```+//!+//! One process runs one library, so neither sees the other's memory or+//! threads. It prints one JSON line. What is measured:+//!+//! * `first_frame_ms`: process start to the first painted frame (data+//! generation excluded: `data_ms`).+//! * scroll (continuous, two rows per frame, driven from the root view's+//! render): per-frame **render to end of paint** time on the main thread+//! (building elements, layout, prepaint, paint: what the application can+//! influence; GPU submission and vsync wait excluded), its mean and+//! percentiles, frames per second, process CPU time per frame (all threads,+//! `QueryProcessCycleTime`), heap allocations per frame (global counting+//! allocator: this thread, and the whole process).+//! * sort of 1M rows by a numeric and by a string column (the library's own+//! path: ours sorts a row mask, the component's delegate sorts its row index+//! with `sort_by`, as its own examples sort their data).+//! * selection and keyboard latency: the event is injected through the+//! window's real dispatch (`Window::dispatch_event`); latency is the dispatch+//! call plus the next frame's render-to-paint time (the vsync wait is not+//! counted).+//! * memory: working set after the scroll, peak working set, private bytes+//! (minus the data's own size, the baseline before the window exists).++#![allow(clippy::too_many_lines)]++#[path = "../../bench/common/measure.rs"]+mod measure;++use std::alloc::{GlobalAlloc, Layout, System};+use std::cell::Cell as StdCell;+use std::sync::Mutex;+use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};+use std::time::{Duration, Instant};++use blenderui_table_gpui as ours;+use gpui::{+ App, AppContext as _, Bounds, Context, Entity, Keystroke, Modifiers, MouseButton, MouseDownEvent, MouseUpEvent,+ ParentElement as _, PlatformInput, Render, SharedString, Styled as _, Window, WindowBounds, WindowOptions, canvas, div,+ point, px, rgb, size, IntoElement,+};+use gpui_component as comp;++// ---- counting allocator -------------------------------------------------------------------------------++struct Counting;++static ALLOCS: AtomicU64 = AtomicU64::new(0);+thread_local! {+ static MAIN_ALLOCS: StdCell<u64> = const { StdCell::new(0) };+}++// SAFETY: forwards to the system allocator; the counters are an atomic and a const thread-local+// without a destructor, so counting never allocates.+unsafe impl GlobalAlloc for Counting {+ unsafe fn alloc(&self, l: Layout) -> *mut u8 {+ ALLOCS.fetch_add(1, Ordering::Relaxed);+ let _ = MAIN_ALLOCS.try_with(|c| c.set(c.get() + 1));+ unsafe { System.alloc(l) }+ }+ unsafe fn dealloc(&self, p: *mut u8, l: Layout) {+ unsafe { System.dealloc(p, l) }+ }+ unsafe fn realloc(&self, p: *mut u8, l: Layout, n: usize) -> *mut u8 {+ ALLOCS.fetch_add(1, Ordering::Relaxed);+ let _ = MAIN_ALLOCS.try_with(|c| c.set(c.get() + 1));+ unsafe { System.realloc(p, l, n) }+ }+}++#[global_allocator]+static A: Counting = Counting;++fn main_allocs() -> u64 {+ MAIN_ALLOCS.with(StdCell::get)+}++// ---- the data -----------------------------------------------------------------------------------------++const NAMES: [&str; 62] = [+ "Cube", "Sphere", "Suzanne", "Torus", "Cone", "Plane", "Cylinder", "Icosphere", "Grid", "Circle", "Monkey", "Empty",+ "Camera", "Light", "Armature", "Lattice", "Curve", "Surface", "Metaball", "Text", "Volume", "Speaker", "Probe", "Force",+ "Bone", "Collection", "Material", "Texture", "Image", "World", "Scene", "Action", "Brush", "Palette", "Mask", "Movie",+ "Sound", "Font", "Node", "Group", "Library", "Object", "Mesh", "Vertex", "Edge", "Face", "Loop", "UV", "Shape", "Key",+ "Driver", "Modifier", "Constraint", "Particle", "Hair", "Cloth", "Fluid", "Smoke", "Rigid", "Soft", "Track", "Marker",+];++/// Rows x columns: column 0 the row number, 1 a name, 2 a price (2 decimals), the rest numbers.+struct Data {+ rows: usize,+ cols: usize,+ name: Vec<u8>,+ price: Vec<f64>,+ nums: Vec<Vec<u64>>,+}++fn mix(r: u64, c: u64) -> u64 {+ let mut x = (r + 1).wrapping_mul(0x9E37_79B9_7F4A_7C15) ^ (c + 7).wrapping_mul(0xD6E8_FEB8_6659_FD93);+ x ^= x >> 29;+ x = x.wrapping_mul(0xBF58_476D_1CE4_E5B9);+ x ^ (x >> 32)+}++impl Data {+ fn new(rows: usize, cols: usize) -> Self {+ Self {+ rows,+ cols,+ name: (0..rows).map(|r| (mix(r as u64, 1) % NAMES.len() as u64) as u8).collect(),+ price: (0..rows).map(|r| (mix(r as u64, 2) % 1_000_000) as f64 / 100.0).collect(),+ nums: (3..cols).map(|c| (0..rows).map(|r| mix(r as u64, c as u64) % 1_000_003).collect()).collect(),+ }+ }++ fn text(&self, r: usize, c: usize) -> String {+ match c {+ 0 => r.to_string(),+ 1 => NAMES[self.name[r] as usize].to_owned(),+ 2 => format!("{:.2}", self.price[r]),+ _ => self.nums[c - 3][r].to_string(),+ }+ }++ fn order(&self, a: usize, b: usize, c: usize) -> std::cmp::Ordering {+ match c {+ 0 => a.cmp(&b),+ 1 => NAMES[self.name[a] as usize].cmp(NAMES[self.name[b] as usize]),+ 2 => self.price[a].total_cmp(&self.price[b]),+ _ => self.nums[c - 3][a].cmp(&self.nums[c - 3][b]),+ }+ }+}++// ---- this crate ---------------------------------------------------------------------------------------++impl ours::CellSource for Data {+ fn cell(&self, r: usize, c: usize) -> ours::Cell<'_> {+ match c {+ 0 => ours::Cell::U64(r as u64),+ 1 => ours::Cell::Str(NAMES[self.name[r] as usize]),+ 2 => ours::Cell::F64(self.price[r], 2),+ _ => ours::Cell::U64(self.nums[c - 3][r]),+ }+ }+}++impl ours::TableDelegate for Data {+ fn columns_count(&self, _: &App) -> usize {+ self.cols+ }+ fn rows_count(&self, _: &App) -> usize {+ self.rows+ }+ fn column(&self, ix: usize, _: &App) -> ours::Column {+ ours::Column::new(format!("c{ix}"), format!("Column {ix}")).sortable().width(px(110.0))+ }+}++// ---- gpui-component -----------------------------------------------------------------------------------++struct CompDelegate {+ data: Data,+ /// Display row -> data row (the delegate sorts this, not the data).+ order: Vec<u32>,+}++impl comp::table::TableDelegate for CompDelegate {+ fn columns_count(&self, _: &App) -> usize {+ self.data.cols+ }+ fn rows_count(&self, _: &App) -> usize {+ self.data.rows+ }+ fn column(&self, ix: usize, _: &App) -> comp::table::Column {+ comp::table::Column::new(format!("c{ix}"), format!("Column {ix}")).sortable().width(px(110.0))+ }+ fn perform_sort(&mut self, col_ix: usize, sort: comp::table::ColumnSort, _: &mut Window, _: &mut Context<comp::table::TableState<Self>>) {+ let data = &self.data;+ match sort {+ comp::table::ColumnSort::Default => self.order.sort_unstable(),+ comp::table::ColumnSort::Ascending => self.order.sort_by(|&a, &b| data.order(a as usize, b as usize, col_ix)),+ comp::table::ColumnSort::Descending => self.order.sort_by(|&a, &b| data.order(b as usize, a as usize, col_ix)),+ }+ }+ fn render_td(&mut self, row_ix: usize, col_ix: usize, _: &mut Window, _: &mut Context<comp::table::TableState<Self>>) -> impl IntoElement {+ SharedString::from(self.data.text(self.order[row_ix] as usize, col_ix))+ }+}++// ---- the harness --------------------------------------------------------------------------------------++#[derive(Clone, Copy, PartialEq, Eq)]+enum Lib {+ Ours,+ Component,+ /// The same window and views without a table: the framework's own per-frame cost.+ Blank,+}++const TABLE_W: f32 = 1200.0;+const TABLE_H: f32 = 700.0;+const ROW_H: f32 = 32.0;+const SCROLL_ROWS_PER_FRAME: usize = 2;++static SCROLLING: AtomicBool = AtomicBool::new(false);+/// Ask for another frame after each one (scrolling or not).+static REPAINT: AtomicBool = AtomicBool::new(false);+static RECORDING: AtomicBool = AtomicBool::new(false);+static FRAMES: AtomicU64 = AtomicU64::new(0);+static TIMES: Mutex<Vec<f64>> = Mutex::new(Vec::new());+/// Nanoseconds of the last frame's render-to-paint time.+static LAST_NS: AtomicU64 = AtomicU64::new(0);++thread_local! {+ static FRAME_START: StdCell<Option<Instant>> = const { StdCell::new(None) };+ /// The table entity, for the stages that act on it.+ static TABLE: StdCell<Option<Table>> = const { StdCell::new(None) };+}++fn table() -> Table {+ let t = TABLE.take();+ let c = t.clone().expect("the table exists");+ TABLE.set(t);+ c+}++#[derive(Clone)]+enum Table {+ Ours(Entity<ours::TableState<Data>>),+ Component(Entity<comp::table::TableState<CompDelegate>>),+ Blank,+}++struct Harness {+ table: Table,+ frame: usize,+}++impl Render for Harness {+ fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {+ FRAME_START.set(Some(Instant::now()));+ self.frame += 1;+ if SCROLLING.load(Ordering::Relaxed) {+ match &self.table {+ Table::Ours(t) => {+ t.update(cx, |s, _| s.scroll_by_px(0.0, f64::from(ROW_H) * SCROLL_ROWS_PER_FRAME as f64, window));+ }+ Table::Component(t) => {+ let row = self.frame * SCROLL_ROWS_PER_FRAME;+ t.update(cx, |s, cx| s.scroll_to_row(row, cx));+ }+ Table::Blank => {}+ }+ }+ if REPAINT.load(Ordering::Relaxed) {+ window.request_animation_frame();+ }+ let holder = div().w(px(TABLE_W)).h(px(TABLE_H));+ let table = match &self.table {+ Table::Ours(t) => holder+ .child(+ ours::DataTable::new(t)+ .stripe(true)+ .unit(px(ROW_H))+ .text_size(px(14.0))+ .header_row_height(px(ROW_H)),+ )+ .into_any_element(),+ Table::Component(t) => holder.child(comp::table::DataTable::new(t).stripe(true)).into_any_element(),+ Table::Blank => holder.into_any_element(),+ };+ div()+ .size_full()+ .bg(rgb(0x1d1d1d))+ .child(table)+ // painted after the table: marks the end of the frame's paint+ .child(canvas(|_, _, _| (), |_, (), _, _| frame_painted()).absolute().size(px(0.0)))+ }+}++fn frame_painted() {+ let Some(t0) = FRAME_START.get() else { return };+ let ns = t0.elapsed().as_nanos() as u64;+ LAST_NS.store(ns, Ordering::Relaxed);+ FRAMES.fetch_add(1, Ordering::Relaxed);+ if RECORDING.load(Ordering::Relaxed) {+ TIMES.lock().unwrap().push(ns as f64 / 1e6);+ }+}++// ---- statistics ---------------------------------------------------------------------------------------++fn pct(sorted: &[f64], p: f64) -> f64 {+ if sorted.is_empty() {+ return 0.0;+ }+ sorted[(((sorted.len() - 1) as f64) * p).round() as usize]+}++fn median(v: &mut [f64]) -> f64 {+ v.sort_by(f64::total_cmp);+ pct(v, 0.5)+}++fn ms(d: Duration) -> f64 {+ d.as_secs_f64() * 1000.0+}++struct Args {+ lib: Lib,+ rows: usize,+ cols: usize,+ secs: f64,+ warm: f64,+}++fn args() -> Args {+ let a: Vec<String> = std::env::args().collect();+ let get = |k: &str, d: &str| a.iter().position(|x| x == k).and_then(|i| a.get(i + 1)).cloned().unwrap_or_else(|| d.to_owned());+ Args {+ lib: match get("--lib", "ours").as_str() {+ "component" => Lib::Component,+ "blank" => Lib::Blank,+ _ => Lib::Ours,+ },+ rows: get("--rows", "1000000").parse().unwrap(),+ cols: get("--cols", "20").parse().unwrap(),+ secs: get("--seconds", "8").parse().unwrap(),+ warm: get("--warmup", "2").parse().unwrap(),+ }+}++fn mb(b: usize) -> f64 {+ b as f64 / (1024.0 * 1024.0)+}++/// Wait until a frame has been painted after this call.+async fn next_frame(cx: &mut gpui::AsyncApp) {+ let n = FRAMES.load(Ordering::Relaxed);+ let t0 = Instant::now();+ while FRAMES.load(Ordering::Relaxed) == n && t0.elapsed() < Duration::from_millis(500) {+ cx.background_executor().timer(Duration::from_millis(1)).await;+ }+}++fn main() {+ let t_start = Instant::now();+ let a = args();+ let hz = std::thread::spawn(|| measure::tsc_hz(Duration::from_millis(300)));+ let data = Data::new(a.rows, a.cols);+ let data_ms = ms(t_start.elapsed());+ let base = measure::memory();+ let hz = hz.join().unwrap();+ let app = gpui_platform::application().with_assets(gpui_kit_assets::Assets);+ app.run(move |cx: &mut App| {+ comp::init(cx);+ let bounds = Bounds::centered(None, size(px(1280.0), px(740.0)), cx);+ let mut data = Some(data);+ let lib = a.lib;+ let window = cx+ .open_window(WindowOptions { window_bounds: Some(WindowBounds::Windowed(bounds)), ..Default::default() }, move |window, cx| {+ let data = data.take().unwrap();+ let table = match lib {+ Lib::Ours => Table::Ours(cx.new(|cx| ours::TableState::new(data, window, cx))),+ Lib::Blank => Table::Blank,+ Lib::Component => {+ let order = (0..data.rows as u32).collect();+ Table::Component(cx.new(|cx| comp::table::TableState::new(CompDelegate { data, order }, window, cx)))+ }+ };+ TABLE.set(Some(table.clone()));+ let view = cx.new(|_| Harness { table, frame: 0 });+ cx.new(|cx| comp::Root::new(view, window, cx))+ })+ .unwrap();+ // the Root wraps the harness: the table state handles for the stages+ let handle = window.into();+ cx.activate(true);+ cx.spawn(async move |cx| run(cx, handle, a, t_start, data_ms, base.working_set, hz).await).detach();+ });+}++/// What one measured stage found.+struct Stage {+ frames: u64,+ fps: f64,+ mean: f64,+ p50: f64,+ p95: f64,+ p99: f64,+ max: f64,+ cpu_ms: f64,+ main_allocs: f64,+ proc_allocs: f64,+}++/// Run frames continuously (scrolling or repainting in place) for `warm` seconds+/// unmeasured, then measure `secs` seconds.+async fn stage(cx: &mut gpui::AsyncApp, handle: gpui::AnyWindowHandle, warm: f64, secs: f64, hz: f64, scroll: bool) -> Stage {+ SCROLLING.store(scroll, Ordering::Relaxed);+ REPAINT.store(true, Ordering::Relaxed);+ // the first frame; each render then asks for the next+ let _ = cx.update(|app| handle.update(app, |_, window, _| window.refresh()));+ cx.background_executor().timer(Duration::from_secs_f64(warm)).await;+ TIMES.lock().unwrap().clear();+ let (f0, c0, p0, w0) = (FRAMES.load(Ordering::Relaxed), measure::cpu_cycles(), ALLOCS.load(Ordering::Relaxed), Instant::now());+ let m0 = cx.update(|_| main_allocs());+ RECORDING.store(true, Ordering::Relaxed);+ cx.background_executor().timer(Duration::from_secs_f64(secs)).await;+ RECORDING.store(false, Ordering::Relaxed);+ let (frames, wall) = (FRAMES.load(Ordering::Relaxed) - f0, w0.elapsed());+ let cpu = Duration::from_secs_f64((measure::cpu_cycles() - c0) as f64 / hz);+ let proc_allocs = ALLOCS.load(Ordering::Relaxed) - p0;+ let main_allocs = cx.update(|_| main_allocs()) - m0;+ SCROLLING.store(false, Ordering::Relaxed);+ REPAINT.store(false, Ordering::Relaxed);+ let mut times = std::mem::take(&mut *TIMES.lock().unwrap());+ times.sort_by(f64::total_cmp);+ let n = frames.max(1) as f64;+ Stage {+ frames,+ fps: frames as f64 / wall.as_secs_f64(),+ mean: times.iter().sum::<f64>() / times.len().max(1) as f64,+ p50: pct(×, 0.5),+ p95: pct(×, 0.95),+ p99: pct(×, 0.99),+ max: times.last().copied().unwrap_or(0.0),+ cpu_ms: cpu.as_secs_f64() * 1000.0 / n,+ main_allocs: main_allocs as f64 / n,+ proc_allocs: proc_allocs as f64 / n,+ }+}++async fn run(cx: &mut gpui::AsyncApp, handle: gpui::AnyWindowHandle, a: Args, t_start: Instant, data_ms: f64, base_ws: usize, hz: f64) {+ // first frame+ while FRAMES.load(Ordering::Relaxed) == 0 {+ cx.background_executor().timer(Duration::from_millis(1)).await;+ }+ let first_frame_ms = ms(t_start.elapsed()) - data_ms;+ cx.background_executor().timer(Duration::from_millis(300)).await;++ // continuous scroll, then repainting the same rows (no new text to shape)+ let scroll = stage(cx, handle, a.warm, a.secs, hz, true).await;+ let after_scroll = measure::memory();+ let still = stage(cx, handle, 1.0, (a.secs / 2.0).max(2.0), hz, false).await;+ cx.background_executor().timer(Duration::from_millis(300)).await;++ // selection (a click on a row) and keyboard (Down) latency+ let mut select = Vec::new();+ let mut key = Vec::new();+ let mut key_works = false;+ for rep in 0..15usize {+ let pos = point(px(300.0), px(ROW_H * (3.0 + (rep % 8) as f32) + ROW_H / 2.0));+ let t = Instant::now();+ let _ = cx.update(|app| {+ handle.update(app, |_, window, app| {+ let down = MouseDownEvent { button: MouseButton::Left, position: pos, modifiers: Modifiers::default(), click_count: 1, first_mouse: false };+ let up = MouseUpEvent { button: MouseButton::Left, position: pos, modifiers: Modifiers::default(), click_count: 1 };+ window.dispatch_event(PlatformInput::MouseDown(down), app);+ window.dispatch_event(PlatformInput::MouseUp(up), app);+ })+ });+ let dispatch = ms(t.elapsed());+ next_frame(cx).await;+ select.push(dispatch + LAST_NS.load(Ordering::Relaxed) as f64 / 1e6);+ let t = Instant::now();+ let handled = cx+ .update(|app| handle.update(app, |_, window, app| window.dispatch_keystroke(Keystroke::parse("down").unwrap(), app)))+ .unwrap_or(false);+ let dispatch = ms(t.elapsed());+ next_frame(cx).await;+ key_works |= handled;+ key.push(dispatch + LAST_NS.load(Ordering::Relaxed) as f64 / 1e6);+ cx.background_executor().timer(Duration::from_millis(20)).await;+ }++ // sorts of all rows+ let mut sort_num = Vec::new();+ let mut sort_str = Vec::new();+ for (col, out) in [(3usize.min(a.cols - 1), &mut sort_num), (1, &mut sort_str)] {+ for sort in [ours::ColumnSort::Ascending, ours::ColumnSort::Descending, ours::ColumnSort::Ascending] {+ let (lib, tab) = (a.lib, table());+ let t = Instant::now();+ let _ = cx.update(|app| {+ handle.update(app, |_, window, app| match (&tab, lib) {+ (Table::Ours(s), Lib::Ours) => s.update(app, |s, cx| s.sort_by(col, sort, window, cx)),+ (Table::Component(s), Lib::Component) => s.update(app, |s, cx| {+ let cs = match sort {+ ours::ColumnSort::Ascending => comp::table::ColumnSort::Ascending,+ ours::ColumnSort::Descending => comp::table::ColumnSort::Descending,+ ours::ColumnSort::Default => comp::table::ColumnSort::Default,+ };+ comp::table::TableDelegate::perform_sort(s.delegate_mut(), col, cs, window, cx);+ cx.notify();+ }),+ _ => {}+ })+ });+ out.push(ms(t.elapsed()));+ next_frame(cx).await;+ }+ }+ let end = measure::memory();+ let (sn, ss) = (median(&mut sort_num), median(&mut sort_str));+ println!(+ "{{\"lib\":\"{}\",\"rows\":{},\"cols\":{},\"data_ms\":{:.0},\"first_frame_ms\":{:.1},\"scroll_frames\":{},\"fps\":{:.1},\+ \"frame_ms_mean\":{:.3},\"frame_ms_p50\":{:.3},\"frame_ms_p95\":{:.3},\"frame_ms_p99\":{:.3},\"frame_ms_max\":{:.3},\+ \"cpu_ms_per_frame\":{:.3},\"main_allocs_per_frame\":{:.1},\"proc_allocs_per_frame\":{:.1},\+ \"still_frame_ms_p50\":{:.3},\"still_cpu_ms_per_frame\":{:.3},\"still_main_allocs_per_frame\":{:.1},\+ \"select_ms\":{:.3},\"key_ms\":{:.3},\"key_works\":{},\"sort_numeric_ms\":{:.1},\"sort_string_ms\":{:.1},\+ \"data_mb\":{:.1},\"ws_after_scroll_mb\":{:.1},\"ws_delta_mb\":{:.1},\"peak_ws_mb\":{:.1},\"private_mb\":{:.1}}}",+ match a.lib {+ Lib::Ours => "ours",+ Lib::Component => "gpui-component",+ Lib::Blank => "blank (no table)",+ },+ a.rows,+ a.cols,+ data_ms,+ first_frame_ms,+ scroll.frames,+ scroll.fps,+ scroll.mean,+ scroll.p50,+ scroll.p95,+ scroll.p99,+ scroll.max,+ scroll.cpu_ms,+ scroll.main_allocs,+ scroll.proc_allocs,+ still.p50,+ still.cpu_ms,+ still.main_allocs,+ median(&mut select),+ median(&mut key),+ key_works,+ sn,+ ss,+ mb(base_ws),+ mb(after_scroll.working_set),+ mb(after_scroll.working_set) - mb(base_ws),+ mb(end.peak_working_set),+ mb(end.private_bytes),+ );+ std::process::exit(0);+}+diff --git a/bindings/rust/blenderui-table-gpui/src/data_table.rs b/bindings/rust/blenderui-table-gpui/src/data_table.rsnew file mode 100644index 0000000..8136685--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/src/data_table.rs@@ -0,0 +1,476 @@+//! [`DataTable`]: the element that shows a [`TableState`] (gpui-component's+//! `DataTable::new(&state)`).+//!+//! A frame builds **two** elements however many rows or columns there are:+//! a focus-tracking wrapper that takes key input, and [`TableElement`], a+//! custom gpui `Element` that lays out as one box, syncs the table with its+//! size in `prepaint`, and in `paint` draws the visible cells with+//! `Window::paint_quad` and shaped lines (via `blenderui_table::paint_table`)+//! and registers the pointer listeners. Cost per frame is O(visible cells).+//! Cells that need rich content opt in through+//! [`TableDelegate::render_td`](crate::TableDelegate::render_td).++use std::rc::Rc;++use blenderui_table::{+ paint_table, with_scratch, Button, Drag, Hit, Key, Mods, Palette, Point as CorePoint, Size, TableEvent, TableOptions,+};+use gpui::{+ AnyElement, App, AvailableSpace, Bounds, ContentMask, CursorStyle, DispatchPhase, Element, ElementId, Entity,+ GlobalElementId, Hitbox, HitboxBehavior, InspectorElementId, InteractiveElement as _, IntoElement, KeyDownEvent,+ LayoutId, Modifiers, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, ParentElement as _, Pixels,+ RenderOnce, ScrollEvent, Style, Styled as _, Window, div, point, px, relative, size,+};++use crate::delegate::TableDelegate;+use blenderui_paint_gpui::GpuiSink;+use crate::state::TableState;++type Listener = Box<dyn Fn(&TableEvent, &mut Window, &mut App)>;++/// The palette a table paints with when none is given: a global the app may set.+#[derive(Clone, Copy, Debug)]+pub struct TablePalette(pub Palette);++impl gpui::Global for TablePalette {}++/// A table element.+///+/// ```ignore+/// let table = cx.new(|cx| TableState::new(MyDelegate::new(), window, cx));+/// // in render:+/// div().size_full().child(DataTable::new(&table).stripe(true).on_select(|row, _, _| println!("{row}")))+/// ```+#[derive(IntoElement)]+pub struct DataTable<D: TableDelegate> {+ state: Entity<TableState<D>>,+ stripe: Option<bool>,+ bordered: Option<bool>,+ size: Option<Size>,+ header_h: Option<f32>,+ fixed_border: Option<bool>,+ scrollbars: Option<(bool, bool)>,+ unit: Option<f32>,+ text_size: Option<f32>,+ palette: Option<Palette>,+ listeners: Vec<Listener>,+}++impl<D: TableDelegate> DataTable<D> {+ #[must_use]+ pub fn new(state: &Entity<TableState<D>>) -> Self {+ Self {+ state: state.clone(),+ stripe: None,+ bordered: None,+ size: None,+ header_h: None,+ fixed_border: None,+ scrollbars: None,+ unit: None,+ text_size: None,+ palette: None,+ listeners: Vec::new(),+ }+ }++ /// Tint every second row (Blender's `draw_alternating_row_overlay`).+ #[must_use]+ pub const fn stripe(mut self, on: bool) -> Self {+ self.stripe = Some(on);+ self+ }+ #[must_use]+ pub const fn bordered(mut self, on: bool) -> Self {+ self.bordered = Some(on);+ self+ }+ #[must_use]+ pub const fn size(mut self, size: Size) -> Self {+ self.size = Some(size);+ self+ }+ #[must_use]+ pub fn header_row_height(mut self, h: impl Into<Pixels>) -> Self {+ self.header_h = Some(f32::from(h.into()));+ self+ }+ #[must_use]+ pub const fn fixed_cols_border(mut self, on: bool) -> Self {+ self.fixed_border = Some(on);+ self+ }+ #[must_use]+ pub const fn scrollbar_visible(mut self, vertical: bool, horizontal: bool) -> Self {+ self.scrollbars = Some((vertical, horizontal));+ self+ }+ /// The UI unit in logical pixels: a medium row is one unit tall and the+ /// text is 0.6 of it (Blender's `UI_UNIT_Y`, 20 there; 24 by default here).+ #[must_use]+ pub fn unit(mut self, unit: impl Into<Pixels>) -> Self {+ self.unit = Some(f32::from(unit.into()));+ self+ }+ /// The text size (default: 0.6 of the unit).+ #[must_use]+ pub fn text_size(mut self, size: impl Into<Pixels>) -> Self {+ self.text_size = Some(f32::from(size.into()));+ self+ }+ /// The colors to paint with (default: the [`TablePalette`] global, else Blender's dark theme).+ #[must_use]+ pub const fn palette(mut self, palette: Palette) -> Self {+ self.palette = Some(palette);+ self+ }++ /// Every table event.+ #[must_use]+ pub fn on_event(mut self, f: impl Fn(&TableEvent, &mut Window, &mut App) + 'static) -> Self {+ self.listeners.push(Box::new(f));+ self+ }+ /// A row was selected (source row index).+ #[must_use]+ pub fn on_select(self, f: impl Fn(usize, &mut Window, &mut App) + 'static) -> Self {+ self.on_event(move |e, w, cx| {+ if let TableEvent::SelectRow(r) = e {+ f(*r, w, cx);+ }+ })+ }+ /// A row was double clicked.+ #[must_use]+ pub fn on_row_double_click(self, f: impl Fn(usize, &mut Window, &mut App) + 'static) -> Self {+ self.on_event(move |e, w, cx| {+ if let TableEvent::DoubleClickedRow(r) = e {+ f(*r, w, cx);+ }+ })+ }+ /// A header click sorted a column (source column index).+ #[must_use]+ pub fn on_sort(self, f: impl Fn(usize, blenderui_table::ColumnSort, &mut Window, &mut App) + 'static) -> Self {+ self.on_event(move |e, w, cx| {+ if let TableEvent::Sorted(c, s) = e {+ f(*c, *s, w, cx);+ }+ })+ }+ /// A column was resized (all widths, view order).+ #[must_use]+ pub fn on_column_resize(self, f: impl Fn(&[Pixels], &mut Window, &mut App) + 'static) -> Self {+ self.on_event(move |e, w, cx| {+ if let TableEvent::ColumnWidthsChanged(v) = e {+ let widths: Vec<Pixels> = v.iter().map(|&w| px(w)).collect();+ f(&widths, w, cx);+ }+ })+ }+ /// A right click on a row (`None`: on empty space).+ #[must_use]+ pub fn on_context_menu(self, f: impl Fn(Option<usize>, &mut Window, &mut App) + 'static) -> Self {+ self.on_event(move |e, w, cx| {+ if let TableEvent::RightClickedRow(r) = e {+ f(*r, w, cx);+ }+ })+ }+}++/// Hand the state's pending events to the listeners.+fn dispatch<D: TableDelegate>(state: &Entity<TableState<D>>, ls: &[Listener], window: &mut Window, cx: &mut App) {+ let events = state.update(cx, |s, _| s.take_events());+ for e in &events {+ for l in ls {+ l(e, window, cx);+ }+ }+}++const fn mods(m: Modifiers) -> Mods {+ // the platform key (command) is the control key of table shortcuts on macOS+ Mods { shift: m.shift, control: m.control || m.platform, alt: m.alt }+}++fn local(pos: gpui::Point<Pixels>, origin: gpui::Point<Pixels>) -> CorePoint {+ CorePoint { x: f32::from(pos.x - origin.x), y: f32::from(pos.y - origin.y) }+}++impl<D: TableDelegate> RenderOnce for DataTable<D> {+ fn render(self, _: &mut Window, cx: &mut App) -> impl IntoElement {+ let Self { state, stripe, bordered, size, header_h, fixed_border, scrollbars, unit, text_size, palette, listeners } = self;+ let focus = gpui::Focusable::focus_handle(state.read(cx), cx);+ let ls: Rc<[Listener]> = listeners.into();+ let key_state = state.clone();+ let key_ls = ls.clone();+ let opts = TableOptionsOverride { stripe, bordered, size, header_h, text_size, fixed_border, scrollbars };+ div()+ .id(("blenderui-data-table", state.entity_id()))+ .size_full()+ .relative()+ .overflow_hidden()+ .track_focus(&focus)+ .key_context("DataTable")+ .on_key_down(move |e: &KeyDownEvent, window, cx| {+ let key = Key::parse(&e.keystroke.key);+ let m = mods(e.keystroke.modifiers);+ let handled = key_state.update(cx, |s, cx| s.key_down(key, m, window, cx));+ dispatch(&key_state, &key_ls, window, cx);+ if handled {+ cx.stop_propagation();+ }+ })+ .child(TableElement { state, opts, unit, palette, listeners: ls })+ }+}++/// The options a [`DataTable`] builder overrides on the state's own.+#[derive(Clone, Copy)]+struct TableOptionsOverride {+ stripe: Option<bool>,+ bordered: Option<bool>,+ size: Option<Size>,+ header_h: Option<f32>,+ text_size: Option<f32>,+ fixed_border: Option<bool>,+ scrollbars: Option<(bool, bool)>,+}++impl TableOptionsOverride {+ fn apply(self, mut o: TableOptions) -> TableOptions {+ o.stripe = self.stripe.unwrap_or(o.stripe);+ o.bordered = self.bordered.unwrap_or(o.bordered);+ o.size = self.size.unwrap_or(o.size);+ o.fixed_cols_border = self.fixed_border.unwrap_or(o.fixed_cols_border);+ o.scrollbars = self.scrollbars.unwrap_or(o.scrollbars);+ o.header_row_height = self.header_h.or(o.header_row_height);+ o.text_size = self.text_size.or(o.text_size);+ o+ }+}++/// The default UI unit (a medium row's height) in logical pixels.+const DEFAULT_UNIT: f32 = 24.0;++/// A rich cell built for this frame.+struct CustomCell {+ element: AnyElement,+ clip: Bounds<Pixels>,+}++/// What `prepaint` found for `paint`.+struct Prepaint {+ hitbox: Hitbox,+ custom: Vec<CustomCell>,+}++/// The custom element: see the module docs.+struct TableElement<D: TableDelegate> {+ state: Entity<TableState<D>>,+ opts: TableOptionsOverride,+ unit: Option<f32>,+ palette: Option<Palette>,+ listeners: Rc<[Listener]>,+}++impl<D: TableDelegate> IntoElement for TableElement<D> {+ type Element = Self;+ fn into_element(self) -> Self {+ self+ }+}++impl<D: TableDelegate> Element for TableElement<D> {+ type RequestLayoutState = ();+ type PrepaintState = Prepaint;++ fn id(&self) -> Option<ElementId> {+ None+ }++ fn source_location(&self) -> Option<&'static core::panic::Location<'static>> {+ None+ }++ fn request_layout(+ &mut self,+ _: Option<&GlobalElementId>,+ _: Option<&InspectorElementId>,+ window: &mut Window,+ cx: &mut App,+ ) -> (LayoutId, ()) {+ let mut style = Style::default();+ style.size.width = relative(1.0).into();+ style.size.height = relative(1.0).into();+ (window.request_layout(style, [], cx), ())+ }++ fn prepaint(+ &mut self,+ _: Option<&GlobalElementId>,+ _: Option<&InspectorElementId>,+ bounds: Bounds<Pixels>,+ &mut (): &mut (),+ window: &mut Window,+ cx: &mut App,+ ) -> Prepaint {+ let opts = self.opts;+ let unit = self.unit.unwrap_or(DEFAULT_UNIT);+ let scale = window.scale_factor();+ let (w, h) = (f32::from(bounds.size.width), f32::from(bounds.size.height));+ let has_custom = self.state.update(cx, |s, cx| {+ s.opts = opts.apply(s.opts);+ if (s.text_scale - scale).abs() > f32::EPSILON {+ s.text.clear();+ s.text_scale = scale;+ }+ s.sync(w, h, unit, scale, window, cx);+ let want = {+ let v = s.visible_range();+ 2 * (v.rows().len() + 1) * (v.cols().len() + 2) + 256+ };+ s.text.ensure_capacity(want);+ s.delegate().has_custom_cells()+ });+ let custom = if has_custom { self.build_custom_cells(bounds, window, cx) } else { Vec::new() };+ Prepaint { hitbox: window.insert_hitbox(bounds, HitboxBehavior::Normal), custom }+ }++ fn paint(+ &mut self,+ _: Option<&GlobalElementId>,+ _: Option<&InspectorElementId>,+ bounds: Bounds<Pixels>,+ &mut (): &mut (),+ pre: &mut Prepaint,+ window: &mut Window,+ cx: &mut App,+ ) {+ let palette = self.palette.unwrap_or_else(|| cx.try_global::<TablePalette>().map_or_else(Palette::blender_dark, |p| p.0));+ let font = window.text_style().font();+ window.with_content_mask(Some(ContentMask { bounds }), |window| {+ self.state.update(cx, |s, cx| {+ s.text.next_generation();+ let st = &mut *s;+ let (core, text) = (&st.core, &mut st.text);+ let mut sink = GpuiSink::new(window, cx, bounds.origin, text, &font, palette.text);+ with_scratch(|scratch| {+ paint_table(core, core.delegate(), &palette, core.delegate().empty_text(), scratch, &mut sink);+ });+ });+ for c in &mut pre.custom {+ window.with_content_mask(Some(ContentMask { bounds: c.clip }), |window| c.element.paint(window, cx));+ }+ });+ self.set_cursor(bounds, &pre.hitbox, window, cx);+ self.register_input(bounds, &pre.hitbox, window);+ }+}++impl<D: TableDelegate> TableElement<D> {+ /// Build the elements of the visible custom cells (the escape hatch).+ fn build_custom_cells(&self, bounds: Bounds<Pixels>, window: &mut Window, cx: &mut App) -> Vec<CustomCell> {+ let mut out = Vec::new();+ let (g, rows, cols) = {+ let s = self.state.read(cx);+ (s.geo(), s.visible_range().rows().clone(), s.visible_range().cols().clone())+ };+ let pinned = self.state.read(cx).layout().pinned();+ for v in (0..pinned).chain(cols) {+ for r in rows.clone() {+ let (row, col, x, y, w) = {+ let s = self.state.read(cx);+ (s.row_at(r), s.layout().src(v), s.col_x(&g, v), s.row_top(&g, r), s.layout().width(v))+ };+ if !self.state.read(cx).delegate().is_custom_cell(row, col) {+ continue;+ }+ let mut element = self.state.update(cx, |s, cx| s.delegate_mut().render_td(row, col, window, cx));+ let origin = bounds.origin + point(px(x), px(y));+ let cell = size(px(w), px(g.row_h));+ element.prepaint_as_root(origin, size(AvailableSpace::Definite(cell.width), AvailableSpace::Definite(cell.height)), window, cx);+ out.push(CustomCell { element, clip: Bounds { origin, size: cell } });+ }+ }+ out+ }++ /// The column-resize cursor over a header border, or while resizing.+ fn set_cursor(&self, bounds: Bounds<Pixels>, hitbox: &Hitbox, window: &mut Window, cx: &mut App) {+ let s = self.state.read(cx);+ let resizing = matches!(s.drag(), Drag::Resize { .. });+ let hot = hitbox.is_hovered(window) && matches!(s.hit(local(window.mouse_position(), bounds.origin)), Hit::Border(_));+ if resizing || hot {+ window.set_cursor_style(CursorStyle::ResizeLeftRight, hitbox);+ }+ }++ /// Pointer and wheel listeners, for this frame.+ fn register_input(&self, bounds: Bounds<Pixels>, hitbox: &Hitbox, window: &mut Window) {+ let origin = bounds.origin;+ for button in [MouseButton::Left, MouseButton::Right] {+ let (state, ls, hitbox) = (self.state.clone(), self.listeners.clone(), hitbox.clone());+ window.on_mouse_event(move |e: &MouseDownEvent, phase, window, cx| {+ if phase != DispatchPhase::Bubble || e.button != button || !hitbox.is_hovered(window) {+ return;+ }+ let focus = gpui::Focusable::focus_handle(state.read(cx), cx);+ window.focus(&focus, cx);+ let b = if button == MouseButton::Left { Button::Left } else { Button::Right };+ let p = local(e.position, origin);+ state.update(cx, |s, cx| s.pointer_down(p, b, mods(e.modifiers), e.click_count, window, cx));+ dispatch(&state, &ls, window, cx);+ });+ }+ let (state, ls, hb) = (self.state.clone(), self.listeners.clone(), hitbox.clone());+ window.on_mouse_event(move |e: &MouseMoveEvent, phase, window, cx| {+ if phase != DispatchPhase::Bubble {+ return;+ }+ let dragging = state.read(cx).dragging();+ if !dragging && !hb.is_hovered(window) {+ return;+ }+ let p = local(e.position, origin);+ state.update(cx, |s, cx| {+ if e.pressed_button.is_none() && dragging {+ s.pointer_up(window, cx);+ } else if !s.pointer_move(p, window, cx) {+ // the cursor changes over a border without any state change+ let over = matches!(s.hit(p), Hit::Border(_));+ if over != s.over_border {+ s.over_border = over;+ window.refresh();+ }+ }+ });+ dispatch(&state, &ls, window, cx);+ });+ let (state, ls) = (self.state.clone(), self.listeners.clone());+ window.on_mouse_event(move |e: &MouseUpEvent, phase, window, cx| {+ if phase != DispatchPhase::Bubble || e.button != MouseButton::Left || !state.read(cx).dragging() {+ return;+ }+ state.update(cx, |s, cx| s.pointer_up(window, cx));+ dispatch(&state, &ls, window, cx);+ });+ let (state, hb) = (self.state.clone(), hitbox.clone());+ window.on_mouse_event(move |e: &ScrollEvent, phase, window, cx| {+ if phase != DispatchPhase::Bubble || !hb.is_hovered(window) {+ return;+ }+ let row_h = px(state.read(cx).geo().row_h);+ let d = e.delta.pixel_delta(row_h);+ // content follows the wheel: a negative delta scrolls down+ let (dx, dy) = (-f64::from(f32::from(d.x)), -f64::from(f32::from(d.y)));+ let sideways = e.modifiers.shift && dx == 0.0;+ let (dx, dy) = if sideways { (dy, 0.0) } else { (dx, dy) };+ let moved = state.update(cx, |s, _| s.scroll_by_px(dx, dy, window));+ if moved {+ cx.stop_propagation();+ }+ });+ }+}diff --git a/bindings/rust/blenderui-table-gpui/src/delegate.rs b/bindings/rust/blenderui-table-gpui/src/delegate.rsnew file mode 100644index 0000000..297f57c--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/src/delegate.rs@@ -0,0 +1,120 @@+//! The data side of a table for gpui: [`TableDelegate`], with the method+//! names of gpui-component's trait and Blender's data-source shape.+//!+//! The cells themselves come from the [`CellSource`] supertrait (shared by+//! every framework adapter): typed, lazy, called for visible cells only.+//! Where gpui-component's `render_td` builds an element for every visible+//! cell, here a cell is *painted* from its [`Cell`](blenderui_table::Cell)+//! value; [`render_td`](TableDelegate::render_td) is the escape hatch for the+//! few cells that need rich content.++use std::ops::Range;++use blenderui_table::{CellSource, Column, ColumnGroup, ColumnSort, VecTable};+use gpui::{AnyElement, App, Context, IntoElement as _, Pixels, Window, div};++use crate::state::TableState;++/// Provides a table's columns and the hooks around it.+#[allow(unused_variables)]+pub trait TableDelegate: CellSource + Sized + 'static {+ /// Number of columns.+ fn columns_count(&self, cx: &App) -> usize;++ /// Number of rows.+ fn rows_count(&self, cx: &App) -> usize;++ /// The column at `col_ix`. Called when the table prepares or refreshes.+ fn column(&self, col_ix: usize, cx: &App) -> Column;++ /// Whether a header click sorts the table's row index list (typed keys,+ /// parallel, no data moved: see [`CellSource::sort_kind`]) rather than+ /// leave sorting to [`perform_sort`](Self::perform_sort).+ fn sort_by_mask(&self) -> bool {+ true+ }++ /// The column was sorted. With [`sort_by_mask`](Self::sort_by_mask) the+ /// table has already reordered its row index list and this is a+ /// notification; otherwise sort your own data here.+ fn perform_sort(&mut self, col_ix: usize, sort: ColumnSort, window: &mut Window, cx: &mut Context<TableState<Self>>) {}++ /// The width column `col_ix` needs to show its content whole, for a+ /// double click on its header border. `None` changes nothing.+ fn fit_column(&mut self, col_ix: usize, window: &mut Window, cx: &mut Context<TableState<Self>>) -> Option<Pixels> {+ None+ }++ /// Column `col_ix` was dragged to index `to_ix` (the table keeps its own+ /// order; this is a notification, e.g. to persist it).+ fn move_column(&mut self, col_ix: usize, to_ix: usize, window: &mut Window, cx: &mut Context<TableState<Self>>) {}++ /// Group header rows above the column headers (outermost first).+ fn group_headers(&self, cx: &App) -> Option<Vec<Vec<ColumnGroup>>> {+ None+ }++ /// Show the loading skeleton instead of rows.+ fn loading(&self, cx: &App) -> bool {+ false+ }++ /// The text shown when there are no rows.+ #[allow(clippy::unnecessary_literal_bound)]+ fn empty_text(&self) -> &str {+ "No data"+ }++ /// More rows can be loaded when scrolling reaches the bottom.+ fn has_more(&self, cx: &App) -> bool {+ false+ }++ /// Remaining rows below the view that trigger [`load_more`](Self::load_more).+ fn load_more_threshold(&self) -> usize {+ 20+ }++ /// Load more rows (called when near the bottom and `has_more`).+ fn load_more(&mut self, window: &mut Window, cx: &mut Context<TableState<Self>>) {}++ /// The visible display rows changed. Keep it fast.+ fn visible_rows_changed(&mut self, visible_range: Range<usize>, window: &mut Window, cx: &mut Context<TableState<Self>>) {}++ /// The visible columns (view indices) changed. Keep it fast.+ fn visible_columns_changed(&mut self, visible_range: Range<usize>, window: &mut Window, cx: &mut Context<TableState<Self>>) {}++ // -- the escape hatch: rich cells, off the fast path ---------------------------------------------++ /// Whether any cell is a custom element. `false` (the default) skips+ /// the per-cell question below altogether.+ fn has_custom_cells(&self) -> bool {+ false+ }++ /// Whether the cell at (`row_ix`, `col_ix`) is built by+ /// [`render_td`](Self::render_td) instead of painted from its value+ /// (return [`Cell::Empty`](blenderui_table::Cell::Empty) from `cell` for it).+ /// Asked only for visible cells.+ fn is_custom_cell(&self, row_ix: usize, col_ix: usize) -> bool {+ false+ }++ /// The element of a custom cell (gpui-component's `render_td`), laid out+ /// in the cell's box. Called every frame for each visible custom cell.+ fn render_td(&mut self, row_ix: usize, col_ix: usize, window: &mut Window, cx: &mut Context<TableState<Self>>) -> AnyElement {+ div().into_any_element()+ }+}++impl TableDelegate for VecTable {+ fn columns_count(&self, _: &App) -> usize {+ self.columns.len()+ }+ fn rows_count(&self, _: &App) -> usize {+ self.rows.len()+ }+ fn column(&self, col_ix: usize, _: &App) -> Column {+ self.columns[col_ix].clone()+ }+}diff --git a/bindings/rust/blenderui-table-gpui/src/lib.rs b/bindings/rust/blenderui-table-gpui/src/lib.rsnew file mode 100644index 0000000..d6953b0--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/src/lib.rs@@ -0,0 +1,45 @@+//! A gpui-component-style `DataTable` for gpui that paints only what is+//! visible, on the framework-independent `blenderui-table` core (Blender's+//! spreadsheet virtualization, index-mask sorting, typed lazy cells, batched+//! quads and a shaped-line cache).+//!+//! * [`TableDelegate`]: your data and hooks (gpui-component's method names).+//! Cells come from `CellSource::cell` as typed values and are painted, not+//! built as elements; [`TableDelegate::render_td`] is the escape hatch for+//! rich cells.+//! * [`TableState`]: the entity: scroll, columns, sort, selection.+//! * [`DataTable`]: the element: a custom gpui `Element`, not a tree of cells.+//!+//! ```ignore+//! use blenderui_table_gpui::*;+//!+//! struct People;+//! impl CellSource for People {+//! fn cell(&self, row: usize, col: usize) -> Cell<'_> {+//! if col == 0 { Cell::U64(row as u64) } else { Cell::U64(row as u64 * 7) }+//! }+//! }+//! impl TableDelegate for People {+//! fn columns_count(&self, _: &App) -> usize { 2 }+//! fn rows_count(&self, _: &App) -> usize { 1_000_000 }+//! fn column(&self, ix: usize, _: &App) -> Column {+//! if ix == 0 { Column::new("id", "ID").sortable().width(px(80.0)) } else { Column::new("v", "Value").sortable() }+//! }+//! }+//!+//! let table = cx.new(|cx| TableState::new(People, window, cx));+//! // in render+//! div().size_full().child(DataTable::new(&table).stripe(true))+//! ```++mod data_table;+mod delegate;+mod state;++pub use blenderui_table::{+ Cell, CellBuf, CellSource, Column, ColumnFixed, ColumnGroup, ColumnLayout, ColumnSort, Palette, RowMask, RowSelection,+ Size, SortKind, TableEvent, TableModel, TableOptions, TableSelection, TableVisibleRange, TextAlign, VecTable,+};+pub use data_table::{DataTable, TablePalette};+pub use delegate::TableDelegate;+pub use state::{GpuiHost, TableState};diff --git a/bindings/rust/blenderui-table-gpui/src/state.rs b/bindings/rust/blenderui-table-gpui/src/state.rsnew file mode 100644index 0000000..0537c0b--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/src/state.rs@@ -0,0 +1,132 @@+//! [`TableState`]: the entity around a [`TableCore`], like gpui-component's+//! `TableState`. The core (in the `blenderui-table` crate) holds the model+//! (scroll, widths, order, sort, selection ...), the delegate, and the glue+//! shared by every adapter; what is here is what needs gpui: the [`Host`]+//! that reaches the delegate's hooks, the window and the clipboard, the focus+//! handle, and the shaped-line cache.+//!+//! The core's API is reachable on the state through `Deref`+//! (`state.rows()`, `state.selected_row()`, `state.set_selected_row(r, cx)`,+//! `state.sort_by(..)` ...).++use std::marker::PhantomData;+use std::ops::{Deref, DerefMut, Range};++use blenderui_table::{table_option_builders, Column, ColumnGroup, ColumnSort, Host, TableCore, TextCache};+use gpui::{px, App, ClipboardItem, Context, FocusHandle, Focusable, Pixels, ShapedLine, Window};++use crate::delegate::TableDelegate;++/// Reaches the delegate trait, the window and the entity context.+pub struct GpuiHost<D>(PhantomData<fn() -> D>);++impl<D: TableDelegate> Host for GpuiHost<D> {+ type Delegate = D;+ type Window = Window;+ type Cx<'a> = Context<'a, TableState<D>>;++ fn columns(d: &D, cx: &Self::Cx<'_>) -> Vec<Column> {+ let app: &App = cx;+ (0..d.columns_count(app)).map(|i| d.column(i, app)).collect()+ }+ fn group_headers(d: &D, cx: &Self::Cx<'_>) -> Option<Vec<Vec<ColumnGroup>>> {+ d.group_headers(cx)+ }+ fn rows_count(d: &D, cx: &Self::Cx<'_>) -> usize {+ d.rows_count(cx)+ }+ fn loading(d: &D, cx: &Self::Cx<'_>) -> bool {+ d.loading(cx)+ }+ fn sort_by_mask(d: &D) -> bool {+ d.sort_by_mask()+ }+ fn perform_sort(d: &mut D, col: usize, sort: ColumnSort, window: &mut Window, cx: &mut Self::Cx<'_>) {+ d.perform_sort(col, sort, window, cx);+ }+ fn move_column(d: &mut D, col: usize, to: usize, window: &mut Window, cx: &mut Self::Cx<'_>) {+ d.move_column(col, to, window, cx);+ }+ fn fit_column(d: &mut D, col: usize, window: &mut Window, cx: &mut Self::Cx<'_>) -> Option<f32> {+ d.fit_column(col, window, cx).map(f32::from)+ }+ fn visible_rows_changed(d: &mut D, rows: Range<usize>, window: &mut Window, cx: &mut Self::Cx<'_>) {+ d.visible_rows_changed(rows, window, cx);+ }+ fn visible_columns_changed(d: &mut D, cols: Range<usize>, window: &mut Window, cx: &mut Self::Cx<'_>) {+ d.visible_columns_changed(cols, window, cx);+ }+ fn has_more(d: &D, cx: &Self::Cx<'_>) -> bool {+ d.has_more(cx)+ }+ fn load_more_threshold(d: &D) -> usize {+ d.load_more_threshold()+ }+ fn load_more(d: &mut D, window: &mut Window, cx: &mut Self::Cx<'_>) {+ d.load_more(window, cx);+ }+ fn write_clipboard(_: &mut Window, cx: &mut Self::Cx<'_>, text: &str) {+ cx.write_to_clipboard(ClipboardItem::new_string(text.to_owned()));+ }+ fn notify(cx: &mut Self::Cx<'_>) {+ cx.notify();+ }+ fn refresh(window: &mut Window) {+ window.refresh();+ }+}++/// How many shaped text runs the cache keeps at least (it grows to twice the+/// visible cells).+const TEXT_CACHE_CAPACITY: usize = 2048;++/// The table.+pub struct TableState<D: TableDelegate> {+ pub(crate) core: TableCore<GpuiHost<D>>,+ focus: FocusHandle,+ /// Shaped text runs kept across frames: scrolling moves the same strings.+ pub(crate) text: TextCache<ShapedLine>,+ /// The scale `text` was shaped at (it is dropped when this changes).+ pub(crate) text_scale: f32,+ /// Whether the pointer was last over a column border (for the cursor).+ pub(crate) over_border: bool,+}++impl<D: TableDelegate> Deref for TableState<D> {+ type Target = TableCore<GpuiHost<D>>;+ fn deref(&self) -> &Self::Target {+ &self.core+ }+}++impl<D: TableDelegate> DerefMut for TableState<D> {+ fn deref_mut(&mut self) -> &mut Self::Target {+ &mut self.core+ }+}++impl<D: TableDelegate> Focusable for TableState<D> {+ fn focus_handle(&self, _: &App) -> FocusHandle {+ self.focus.clone()+ }+}++impl<D: TableDelegate> TableState<D> {+ pub fn new(delegate: D, _: &mut Window, cx: &mut Context<Self>) -> Self {+ Self {+ core: TableCore::new(delegate, cx),+ focus: cx.focus_handle(),+ text: TextCache::new(TEXT_CACHE_CAPACITY),+ text_scale: 1.0,+ over_border: false,+ }+ }++ // gpui-component's builders+ table_option_builders!();++ /// The width of delegate column `col_ix`.+ pub fn col_width(&self, col_ix: usize) -> Option<Pixels> {+ self.core.col_width(col_ix).map(px)+ }+}diff --git a/bindings/rust/blenderui-table-gpui/tests/gpui.rs b/bindings/rust/blenderui-table-gpui/tests/gpui.rsnew file mode 100644index 0000000..6692f6f--- /dev/null+++ b/bindings/rust/blenderui-table-gpui/tests/gpui.rs@@ -0,0 +1,156 @@+//! The adapter on gpui's test platform: layout, input dispatched through the+//! window, sorting, selection, the keyboard and the custom-cell escape hatch.+//! (The test platform lays out and paints into a scene without a GPU, so+//! pixels are not checked here; the head-to-head benchmark measures real frames.)++use std::sync::Arc;+use std::sync::atomic::{AtomicUsize, Ordering};++use blenderui_table_gpui::{Cell, CellSource, Column, ColumnSort, DataTable, TableDelegate, TableState};+use gpui::{+ AnyElement, App, AppContext as _, Context, Entity, IntoElement, Modifiers, ParentElement as _, Render, ScrollDelta,+ ScrollEvent, Styled as _, TestAppContext, Window, div, point, px,+};++/// rows x 6 numbers; column 2 can be a custom cell.+struct Grid {+ rows: usize,+ custom: bool,+ built: Arc<AtomicUsize>,+}++const fn val(r: usize, c: usize) -> u64 {+ (r as u64 * 2_654_435_761 + c as u64 * 40_503) % 100_003+}++impl CellSource for Grid {+ fn cell(&self, row: usize, col: usize) -> Cell<'_> {+ if self.custom && col == 2 { Cell::Empty } else { Cell::U64(val(row, col)) }+ }+}++impl TableDelegate for Grid {+ fn columns_count(&self, _: &App) -> usize {+ 6+ }+ fn rows_count(&self, _: &App) -> usize {+ self.rows+ }+ fn column(&self, ix: usize, _: &App) -> Column {+ Column::new(format!("c{ix}"), format!("Col {ix}")).sortable().width(px(100.0_f32))+ }+ fn has_custom_cells(&self) -> bool {+ self.custom+ }+ fn is_custom_cell(&self, _: usize, col: usize) -> bool {+ self.custom && col == 2+ }+ fn render_td(&mut self, row: usize, _: usize, _: &mut Window, _: &mut Context<TableState<Self>>) -> AnyElement {+ self.built.fetch_add(1, Ordering::Relaxed);+ div().child(format!("rich {row}")).into_any_element()+ }+}++struct View(Entity<TableState<Grid>>);++impl Render for View {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ div().w(px(600.0)).h(px(300.0)).child(DataTable::new(&self.0).stripe(true).unit(px(24.0)).header_row_height(px(24.0)))+ }+}++fn setup(cx: &mut TestAppContext, rows: usize, custom: bool) -> (Entity<TableState<Grid>>, Arc<AtomicUsize>, &mut gpui::VisualTestContext) {+ let built = Arc::new(AtomicUsize::new(0));+ let b = built.clone();+ let (view, cx) = cx.add_window_view(move |window, cx| {+ View(cx.new(|cx| TableState::new(Grid { rows, custom, built: b }, window, cx)))+ });+ cx.update(|window, cx| window.draw(cx).clear(cx));+ let table = view.read_with(cx, |v, _| v.0.clone());+ (table, built, cx)+}++fn redraw(cx: &mut gpui::VisualTestContext) {+ cx.update(|window, cx| window.draw(cx).clear(cx));+}++#[gpui::test]+fn only_the_visible_cells_are_in_range_and_the_wheel_scrolls(cx: &mut TestAppContext) {+ let (table, _, cx) = setup(cx, 1_000_000, false);+ let first = table.read_with(cx, |t, _| t.visible_range().clone());+ assert_eq!(first.rows().start, 0);+ assert!(first.rows().len() <= 13, "{:?}", first.rows());+ assert!(first.cols().len() <= 6);+ cx.simulate_event(ScrollEvent {+ position: point(px(300.0), px(150.0)),+ delta: ScrollDelta::Pixels(point(px(0.0), px(-2400.0))),+ ..Default::default()+ });+ redraw(cx);+ let moved = table.read_with(cx, |t, _| t.visible_range().rows().clone());+ assert!(moved.start >= 90, "{moved:?}");+ assert!(moved.len() <= 13);+ // scrolling to the end of a million rows+ table.update(cx, |t, _| t.scroll_by(0.0, 1e12));+ redraw(cx);+ assert_eq!(table.read_with(cx, |t, _| t.visible_range().rows().end), 1_000_000);+}++#[gpui::test]+fn clicks_select_rows_and_the_keyboard_moves_the_selection(cx: &mut TestAppContext) {+ let (table, _, cx) = setup(cx, 100, false);+ let row_y = |r: usize| px(24.0 + 24.0 * r as f32 + 12.0);+ cx.simulate_click(point(px(250.0), row_y(2)), Modifiers::none());+ assert_eq!(table.read_with(cx, |t, _| t.selected_row()), Some(2));+ cx.simulate_keystrokes("down down");+ assert_eq!(table.read_with(cx, |t, _| t.selected_row()), Some(4));+ cx.simulate_keystrokes("up");+ assert_eq!(table.read_with(cx, |t, _| t.selected_row()), Some(3));+ cx.simulate_click(point(px(250.0), row_y(6)), Modifiers::shift());+ assert_eq!(table.read_with(cx, |t, _| t.selected_rows().collect::<Vec<_>>()), vec![3, 4, 5, 6]);+ cx.simulate_keystrokes("escape");+ assert_eq!(table.read_with(cx, |t, _| t.selected_rows().count()), 0);+}++#[gpui::test]+fn a_header_click_sorts_by_index_mask_and_cycles(cx: &mut TestAppContext) {+ let n = 5000;+ let (table, _, cx) = setup(cx, n, false);+ let min = (0..n).map(|r| val(r, 1)).min().unwrap();+ let max = (0..n).map(|r| val(r, 1)).max().unwrap();+ let header = point(px(150.0), px(12.0)); // column 1 spans 100..200+ cx.simulate_click(header, Modifiers::none());+ assert_eq!(table.read_with(cx, |t, _| t.sorted_by()), Some((1, ColumnSort::Ascending)));+ assert_eq!(table.read_with(cx, |t, _| val(t.row_at(0), 1)), min);+ cx.simulate_click(header, Modifiers::none());+ assert_eq!(table.read_with(cx, |t, _| val(t.row_at(0), 1)), max);+ cx.simulate_click(header, Modifiers::none());+ assert_eq!(table.read_with(cx, |t, _| (t.sorted_by(), t.row_at(7))), (None, 7));+}++#[gpui::test]+fn custom_cells_are_built_only_for_the_visible_rows(cx: &mut TestAppContext) {+ let (table, built, cx) = setup(cx, 1_000_000, true);+ let visible = table.read_with(cx, |t, _| t.visible_range().rows().len());+ assert!(built.load(Ordering::Relaxed) >= visible, "{} custom cells for {visible} rows", built.load(Ordering::Relaxed));+ assert!(built.load(Ordering::Relaxed) <= 3 * visible + 3, "{} custom cells for {visible} rows", built.load(Ordering::Relaxed));+ built.store(0, Ordering::Relaxed);+ redraw(cx);+ let per_frame = built.load(Ordering::Relaxed);+ assert!(per_frame >= visible && per_frame <= visible + 2, "{per_frame} per frame for {visible} rows");+}++#[gpui::test]+fn the_selection_api_and_events(cx: &mut TestAppContext) {+ let (table, _, cx) = setup(cx, 1000, false);+ table.update(cx, |t, cx| t.set_selected_row(500, cx));+ assert_eq!(table.read_with(cx, |t, _| t.selected_row()), Some(500));+ redraw(cx);+ // the selected row was scrolled into view+ assert!(table.read_with(cx, |t, _| t.visible_range().rows().contains(&500)));+ table.update(cx, |t, cx| t.set_filter(|d, r| val(r, 1).is_multiple_of(2) && d.rows > 0, cx));+ assert!(table.read_with(cx, |t, _| t.rows()) < 1000);+ table.update(cx, |t, cx| t.clear_filter(cx));+ assert_eq!(table.read_with(cx, |t, _| t.rows()), 1000);+ assert_eq!(table.read_with(cx, |t, _| t.selection_text()), "");+}diff --git a/bindings/rust/blenderui-table/Cargo.toml b/bindings/rust/blenderui-table/Cargo.tomlnew file mode 100644index 0000000..2cb5bbe--- /dev/null+++ b/bindings/rust/blenderui-table/Cargo.toml@@ -0,0 +1,47 @@+[package]+name = "blenderui-table"+description = "Framework-independent data-table core: Blender spreadsheet virtualization, index masks, typed sorting, selection, layout and a paint-sink trait"+version.workspace = true+edition.workspace = true+license.workspace = true+repository.workspace = true+homepage.workspace = true+authors.workspace = true+rust-version.workspace = true+documentation = "https://docs.rs/blenderui-table"+keywords = ["table", "virtualization", "spreadsheet", "gui", "blender"]+categories = ["gui", "data-structures"]+readme = "README.md"+include = ["src/**", "tests/**", "README.md", "Cargo.toml"]+publish = false++[dependencies]+blenderui-paint = { path = "../blenderui-paint", version = "0.2.0" }++[lints.clippy]+all = { level = "warn", priority = -2 }+pedantic = { level = "warn", priority = -2 }+perf = { level = "warn", priority = -1 }+complexity = { level = "warn", priority = -1 }+inline_always = "allow"+unseparated_literal_suffix = "allow"+similar_names = "allow"+missing_panics_doc = "allow"+missing_errors_doc = "allow"+absolute_paths = "allow"+module_name_repetitions = "allow"+doc_markdown = "allow"+too_many_lines = "allow"+unused_self = "allow"+cast_possible_truncation = "allow"+cast_sign_loss = "allow"+cast_precision_loss = "allow"+unreadable_literal = "allow"+implicit_hasher = "allow"+significant_drop_tightening = "warn"+redundant_clone = "warn"+use_self = "warn"+redundant_else = "warn"+or_fun_call = "warn"+missing_const_for_fn = "warn"+derive_partial_eq_without_eq = "warn"diff --git a/bindings/rust/blenderui-table/README.md b/bindings/rust/blenderui-table/README.mdnew file mode 100644index 0000000..6553e80--- /dev/null+++ b/bindings/rust/blenderui-table/README.md@@ -0,0 +1,64 @@+# blenderui-table++A framework-independent, virtualized data table: the logic once, for every UI+framework. `std` only, no dependencies.++The design is Blender's spreadsheet editor+(`source/blender/editors/space_spreadsheet`) with Blender's other UI+optimizations. A frame costs O(visible cells), however many rows there are.++| Blender | Here |+|---|---|+| `get_visible_rows`, column culling in `spreadsheet_draw.cc` | `visible`: range math in `f64` (saturating, NaN-safe), column bisection |+| `IndexMask`, `spreadsheet_row_filter.cc` | `mask::RowMask`, `sort`: sorting and filtering never reorder data |+| `GVArray` column values | `cell::CellSource` / `Cell`: typed, lazy cells, formatted into stack buffers (`fmt::CellBuf`, no allocation) |+| `UI_widgetbase_draw_cache` (batched quads) | `paint`: a selection of any number of rows is one quad, a column separator one quad |+| BLF glyph cache | `text_cache::TextCache`: bounded, generation-tagged cache of shaped text runs or widths |++## Layers++```text+ your data ----> CellSource (cells, typed; sort kind)+ TableModel state: columns, mask, selection, scroll, size+ interact pointer / wheel / keyboard -> model + queued TableEvents+ paint model + data -> PaintSink (rects, text, clips)+ TableCore<H> model + delegate + the glue every adapter needs, behind `Host`+```++An adapter for a framework (`blenderui`'s `table` module, `blenderui-table-gpui`)+implements three small things and nothing else:++1. `Host`: names the framework's window and context types and forwards the+ delegate hooks, the clipboard and redraw calls (a dozen one-liners).+2. `PaintSink`: draws rectangles, lines and text, scopes clips, and owns the+ framework's text cache.+3. An element that feeds `TableCore` the framework's pointer, wheel and key+ events (as `Button`, `Mods`, `Key`) and calls `paint_table` while painting.++Sorting, filtering, selection, keyboard navigation, column resize and move,+TSV copy, scrolling, hit testing and every pixel of layout are in this crate.++## Sorting++`sort::sorted_by_column` sorts a `RowMask`, stable, parallel above 32k rows:++* A column whose cells are all numbers of one variant, or all text, sorts+ through **typed keys**: one pass extracts an order-preserving `u64` per row+ (integers, floats by `f64::total_cmp`, the first 8 bytes of text), then+ `(key, position)` pairs sort with no cell access and no dynamic call per+ comparison. Text resolves equal prefixes with a stable sort of those runs.+* Anything else (mixed variants, `SortKind::Custom`) sorts with a comparator+ on the index list: the generic path the typed one must equal. The tests+ check they agree for every direction, on filtered masks, with `NaN`,+ infinities and ties.++## Tests++`cargo test -p blenderui-table`: unit tests for every module (reference+implementations, seeded random inputs), model tests through the public API+(input, sorting, keyboard, copy, drags), a randomized event soak that checks+the invariants after every event, extreme sizes (`usize::MAX / 4` rows, `NaN`+and infinite scrolls, zero and negative sizes), and counting-allocator tests+that a steady-state paint and a text-cache hit allocate nothing.++License: GPL-2.0-or-later, like the rest of BUI.diff --git a/bindings/rust/blenderui-table/src/alloc_probe.rs b/bindings/rust/blenderui-table/src/alloc_probe.rsnew file mode 100644index 0000000..9558b72--- /dev/null+++ b/bindings/rust/blenderui-table/src/alloc_probe.rs@@ -0,0 +1,7 @@+//! The counting allocator for this crate's tests (shared with the other+//! cores: it lives in `blenderui-paint`).++pub use blenderui_paint::testing::count_allocs;++#[global_allocator]+static A: blenderui_paint::testing::Counting = blenderui_paint::testing::Counting;diff --git a/bindings/rust/blenderui-table/src/cell.rs b/bindings/rust/blenderui-table/src/cell.rsnew file mode 100644index 0000000..4cf46ca--- /dev/null+++ b/bindings/rust/blenderui-table/src/cell.rs@@ -0,0 +1,210 @@+//! Cell values: Blender's lazily evaluated, typed column values+//! (`blender::bke::GVArray` read through `spreadsheet_data_source.hh`) for a+//! table. A cell is fetched only when drawn or compared, as a borrowed+//! `&str` or a number; numbers are formatted into a stack [`CellBuf`].++use std::cmp::Ordering;++use crate::fmt::CellBuf;++/// One cell's value.+#[derive(Copy, Clone, Debug, PartialEq)]+pub enum Cell<'a> {+ /// Nothing is drawn.+ Empty,+ Str(&'a str),+ I64(i64),+ U64(u64),+ /// A float shown with a fixed number of decimals (at most 9).+ F64(f64, u8),+}++/// The kind of a cell, for typed sort keys: columns whose cells all have the+/// same kind sort without comparing cells.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub enum CellKind {+ Empty,+ Number,+ Text,+}++impl Cell<'_> {+ #[must_use]+ pub const fn kind(&self) -> CellKind {+ match self {+ Cell::Empty => CellKind::Empty,+ Cell::Str(_) => CellKind::Text,+ _ => CellKind::Number,+ }+ }++ /// The text shown: borrowed, or formatted into `buf`.+ #[must_use]+ pub fn text<'b>(&'b self, buf: &'b mut CellBuf) -> &'b str {+ match *self {+ Cell::Empty => "",+ Cell::Str(s) => s,+ Cell::I64(v) => {+ buf.clear();+ buf.push_i64(v);+ buf.as_str()+ }+ Cell::U64(v) => {+ buf.clear();+ buf.push_u64(v);+ buf.as_str()+ }+ Cell::F64(v, d) => {+ buf.clear();+ buf.push_f64(v, d);+ buf.as_str()+ }+ }+ }++ /// An order-preserving `u64` for a numeric cell (`None` for text and+ /// empty cells): integers keep their order, floats follow `f64::total_cmp`.+ /// Only meaningful between cells of the same variant.+ #[must_use]+ pub const fn number_key(&self) -> Option<u64> {+ match *self {+ Cell::I64(v) => Some((v as u64) ^ (1 << 63)),+ Cell::U64(v) => Some(v),+ Cell::F64(v, _) => {+ let bits = v.to_bits();+ Some(if bits >> 63 == 1 { !bits } else { bits | (1 << 63) })+ }+ _ => None,+ }+ }++ /// The first 8 bytes of a text cell, big endian, zero padded: orders like+ /// the text up to ties.+ #[must_use]+ pub fn text_prefix(&self) -> Option<u64> {+ if let Cell::Str(s) = self {+ let b = s.as_bytes();+ let mut p = [0u8; 8];+ let n = b.len().min(8);+ p[..n].copy_from_slice(&b[..n]);+ Some(u64::from_be_bytes(p))+ } else {+ None+ }+ }++ /// The table's total order over cells: empty cells first, then numbers+ /// (by value; mixed integer and float compare as floats), then text+ /// (byte order).+ #[must_use]+ pub fn sort_cmp(&self, other: &Cell<'_>) -> Ordering {+ match (self, other) {+ (Cell::Str(a), Cell::Str(b)) => a.cmp(b),+ (Cell::I64(a), Cell::I64(b)) => a.cmp(b),+ (Cell::U64(a), Cell::U64(b)) => a.cmp(b),+ (Cell::F64(a, _), Cell::F64(b, _)) => a.total_cmp(b),+ (Cell::I64(a), Cell::U64(b)) => {+ if *a < 0 { Ordering::Less } else { (*a as u64).cmp(b) }+ }+ (Cell::U64(_), Cell::I64(_)) => other.sort_cmp(self).reverse(),+ _ => match (self.kind(), other.kind()) {+ (CellKind::Number, CellKind::Number) => self.as_f64().total_cmp(&other.as_f64()),+ (a, b) => rank(a).cmp(&rank(b)),+ },+ }+ }++ const fn as_f64(&self) -> f64 {+ match *self {+ Cell::I64(v) => v as f64,+ Cell::U64(v) => v as f64,+ Cell::F64(v, _) => v,+ _ => 0.0,+ }+ }+}++const fn rank(k: CellKind) -> u8 {+ match k {+ CellKind::Empty => 0,+ CellKind::Number => 1,+ CellKind::Text => 2,+ }+}++/// How a column is sorted.+#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]+pub enum SortKind {+ /// By the cells' own order ([`Cell::sort_cmp`]); the table extracts typed+ /// keys when the column's cells are all numbers of one variant or all text.+ #[default]+ Cells,+ /// By [`CellSource::compare`], called per comparison (slower).+ Custom,+}++/// Where a table's cells come from: Blender's `DataSource`. Implementations+/// compute or borrow a cell on demand; nothing is stored per cell.+///+/// `Sync` because sorting reads cells from several threads.+pub trait CellSource: Sync {+ /// The cell at (`row`, `col`), both source indices (rows are data rows,+ /// whatever the display order).+ fn cell(&self, row: usize, col: usize) -> Cell<'_>;++ /// How column `col` sorts; override with [`SortKind::Custom`] and+ /// [`compare`](Self::compare) for an order the cells do not express.+ fn sort_kind(&self, col: usize) -> SortKind {+ let _ = col;+ SortKind::Cells+ }++ /// Order rows `a` and `b` by column `col` (used for [`SortKind::Custom`]).+ fn compare(&self, col: usize, a: usize, b: usize) -> Ordering {+ self.cell(a, col).sort_cmp(&self.cell(b, col))+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn text_formats_into_the_buffer() {+ let mut b = CellBuf::new();+ assert_eq!(Cell::Empty.text(&mut b), "");+ assert_eq!(Cell::Str("hi").text(&mut b), "hi");+ assert_eq!(Cell::I64(-42).text(&mut b), "-42");+ assert_eq!(Cell::U64(7).text(&mut b), "7");+ assert_eq!(Cell::F64(12.5, 1).text(&mut b), "12.5");+ }++ #[test]+ fn keys_preserve_order() {+ let ints = [i64::MIN, -5, -1, 0, 1, 7, i64::MAX];+ for w in ints.windows(2) {+ assert!(Cell::I64(w[0]).number_key() < Cell::I64(w[1]).number_key());+ }+ let floats = [f64::NEG_INFINITY, -1e9, -1.5, -0.0, 0.0, 1e-300, 2.5, f64::INFINITY, f64::NAN];+ for w in floats.windows(2) {+ let (a, b) = (Cell::F64(w[0], 2), Cell::F64(w[1], 2));+ assert!(a.number_key() < b.number_key(), "{w:?}");+ assert_eq!(a.sort_cmp(&b), Ordering::Less);+ }+ assert!(Cell::Str("abcdefgh").text_prefix() < Cell::Str("abcdefgi").text_prefix());+ assert_eq!(Cell::Str("abcdefghX").text_prefix(), Cell::Str("abcdefghY").text_prefix());+ }++ #[test]+ fn total_order_across_kinds() {+ use Cell::{Empty, F64, I64, Str, U64};+ let order = [Empty, I64(-1), F64(0.5, 1), U64(1), I64(2), Str("a"), Str("b")];+ for i in 0..order.len() {+ for j in 0..order.len() {+ assert_eq!(order[i].sort_cmp(&order[j]), i.cmp(&j), "{:?} {:?}", order[i], order[j]);+ }+ }+ assert_eq!(I64(-3).sort_cmp(&U64(0)), Ordering::Less);+ assert_eq!(U64(u64::MAX).sort_cmp(&I64(i64::MAX)), Ordering::Greater);+ }+}diff --git a/bindings/rust/blenderui-table/src/column.rs b/bindings/rust/blenderui-table/src/column.rsnew file mode 100644index 0000000..04e36e2--- /dev/null+++ b/bindings/rust/blenderui-table/src/column.rs@@ -0,0 +1,467 @@+//! Columns: their description ([`Column`], named as in gpui-component) and+//! their live layout (order, widths, edges) in [`ColumnLayout`].+//!+//! Blender keeps one `SpreadsheetColumn` per column with a width in+//! `SPREADSHEET_WIDTH_UNIT`s and recomputes the left edges while drawing+//! (`spreadsheet_draw.cc`); here the edges are cached in two strips (pinned+//! columns, then the scrolling ones) and only rebuilt when a width or the+//! order changes, so drawing culls them by bisection ([`visible_cols`]).+//!+//! [`visible_cols`]: crate::visible::visible_cols++use std::borrow::Cow;++/// Column and header text: a static string or an owned one.+pub type Text = Cow<'static, str>;++/// Horizontal alignment of a column's cells.+#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]+pub enum TextAlign {+ #[default]+ Left,+ Center,+ Right,+}++/// Whether a column sorts and in which direction (gpui-component's name).+#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]+pub enum ColumnSort {+ /// Sortable, not sorted now (the original order).+ #[default]+ Default,+ /// Sorted ascending.+ Ascending,+ /// Sorted descending.+ Descending,+}++impl ColumnSort {+ /// What a header click does next: default, ascending, descending, default.+ #[must_use]+ pub const fn next(self) -> Self {+ match self {+ Self::Default => Self::Ascending,+ Self::Ascending => Self::Descending,+ Self::Descending => Self::Default,+ }+ }+}++/// A pinned column.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub enum ColumnFixed {+ /// Stays at the left edge while the table scrolls horizontally.+ Left,+}++/// A header cell spanning several columns (gpui-component's `ColumnGroup`).+#[derive(Debug, Clone)]+pub struct ColumnGroup {+ pub label: Text,+ pub span: usize,+}++impl ColumnGroup {+ pub fn new(label: impl Into<Text>, span: usize) -> Self {+ Self { label: label.into(), span }+ }+}++/// A column, as the delegate describes it (gpui-component's fields and+/// builders). Widths are logical pixels.+#[derive(Debug, Clone)]+#[allow(clippy::struct_excessive_bools)]+pub struct Column {+ /// Identifies the column in your data (usually the field name).+ pub key: Text,+ /// The header text.+ pub name: Text,+ pub align: TextAlign,+ /// `None`: not sortable.+ pub sort: Option<ColumnSort>,+ pub width: f32,+ pub fixed: Option<ColumnFixed>,+ pub resizable: bool,+ pub movable: bool,+ pub selectable: bool,+ pub min_width: f32,+ pub max_width: f32,+ /// Hidden columns take no space and are never drawn.+ pub visible: bool,+}++impl Default for Column {+ fn default() -> Self {+ Self {+ key: Text::default(),+ name: Text::default(),+ align: TextAlign::Left,+ sort: None,+ width: 100.0,+ fixed: None,+ resizable: true,+ movable: true,+ selectable: true,+ min_width: 20.0,+ max_width: 1200.0,+ visible: true,+ }+ }+}++impl Column {+ /// `w` limited to this column's min and max; a `NaN` (or a min above the+ /// max) cannot make it through: the default width is used for a `NaN`.+ #[must_use]+ pub fn clamp_width(&self, w: f32) -> f32 {+ let w = if w.is_nan() { Self::default().width } else { w };+ let (lo, hi) = if self.min_width <= self.max_width { (self.min_width, self.max_width) } else { (self.max_width, self.max_width) };+ w.clamp(if lo.is_nan() { 0.0 } else { lo }, if hi.is_nan() { f32::MAX } else { hi })+ }++ /// This column's own width, limited as [`clamp_width`](Self::clamp_width) does.+ #[must_use]+ pub fn clamped_width(&self) -> f32 {+ self.clamp_width(self.width)+ }++ pub fn new(key: impl Into<Text>, name: impl Into<Text>) -> Self {+ Self { key: key.into(), name: name.into(), ..Self::default() }+ }+ /// Sortable (header click cycles ascending, descending, original order).+ #[must_use]+ pub const fn sortable(mut self) -> Self {+ self.sort = Some(ColumnSort::Default);+ self+ }+ #[must_use]+ pub const fn sort(mut self, sort: ColumnSort) -> Self {+ self.sort = Some(sort);+ self+ }+ #[must_use]+ pub const fn ascending(self) -> Self {+ self.sort(ColumnSort::Ascending)+ }+ #[must_use]+ pub const fn descending(self) -> Self {+ self.sort(ColumnSort::Descending)+ }+ #[must_use]+ pub const fn text_center(mut self) -> Self {+ self.align = TextAlign::Center;+ self+ }+ #[must_use]+ pub const fn text_right(mut self) -> Self {+ self.align = TextAlign::Right;+ self+ }+ #[must_use]+ pub fn width(mut self, width: impl Into<f32>) -> Self {+ self.width = width.into();+ self+ }+ #[must_use]+ pub const fn fixed(mut self, fixed: ColumnFixed) -> Self {+ self.fixed = Some(fixed);+ self+ }+ #[must_use]+ pub const fn fixed_left(self) -> Self {+ self.fixed(ColumnFixed::Left)+ }+ #[must_use]+ pub const fn resizable(mut self, on: bool) -> Self {+ self.resizable = on;+ self+ }+ #[must_use]+ pub const fn movable(mut self, on: bool) -> Self {+ self.movable = on;+ self+ }+ #[must_use]+ pub const fn selectable(mut self, on: bool) -> Self {+ self.selectable = on;+ self+ }+ #[must_use]+ pub fn min_width(mut self, w: impl Into<f32>) -> Self {+ self.min_width = w.into();+ self+ }+ #[must_use]+ pub fn max_width(mut self, w: impl Into<f32>) -> Self {+ self.max_width = w.into();+ self+ }+ #[must_use]+ pub const fn visible(mut self, on: bool) -> Self {+ self.visible = on;+ self+ }+}++/// Order, widths and edges of the columns on screen.+///+/// "View" indices count visible columns left to right: pinned ones first,+/// then the scrolling ones. "Source" indices are the delegate's.+#[derive(Debug, Clone, Default)]+pub struct ColumnLayout {+ cols: Vec<Column>,+ /// View index -> source index.+ order: Vec<u32>,+ /// Width by source index.+ widths: Vec<f32>,+ pinned: usize,+ /// Left edges within the pinned strip (`pinned + 1` entries).+ xf: Vec<f32>,+ /// Left edges within the scrolling strip.+ xs: Vec<f32>,+}++impl ColumnLayout {+ pub fn new(cols: Vec<Column>) -> Self {+ let mut l = Self { widths: cols.iter().map(Column::clamped_width).collect(), cols, ..Self::default() };+ l.reorder_default();+ l+ }++ /// Replace the column list (the delegate changed): widths of columns+ /// with the same key survive, and so does their order.+ pub fn reset(&mut self, cols: Vec<Column>) {+ let old: Vec<(Text, f32)> =+ self.order.iter().map(|&s| (self.cols[s as usize].key.clone(), self.widths[s as usize])).collect();+ *self = Self::new(cols);+ // keep the user's widths and order for the columns that remain+ let mut placed = 0;+ for (key, w) in old {+ if let Some(src) = self.cols.iter().position(|c| c.key == key && !key.is_empty()) {+ self.widths[src] = self.cols[src].clamp_width(w);+ if let Some(at) = self.order.iter().position(|&s| s as usize == src)+ && at >= placed && self.group(src) == self.group(self.order[placed] as usize) {+ self.order.swap(at, placed);+ placed += 1;+ }+ }+ }+ self.rebuild_edges();+ }++ fn group(&self, src: usize) -> bool {+ self.cols[src].fixed.is_some()+ }++ fn reorder_default(&mut self) {+ let vis = |c: &Column| c.visible;+ self.order = (0..self.cols.len() as u32)+ .filter(|&i| vis(&self.cols[i as usize]) && self.cols[i as usize].fixed.is_some())+ .chain((0..self.cols.len() as u32).filter(|&i| vis(&self.cols[i as usize]) && self.cols[i as usize].fixed.is_none()))+ .collect();+ self.rebuild_edges();+ }++ fn rebuild_edges(&mut self) {+ self.pinned = self.order.iter().take_while(|&&s| self.cols[s as usize].fixed.is_some()).count();+ let (xf, xs) = (&mut self.xf, &mut self.xs);+ xf.clear();+ xs.clear();+ xf.push(0.0);+ xs.push(0.0);+ for (v, &s) in self.order.iter().enumerate() {+ let strip = if v < self.pinned { &mut *xf } else { &mut *xs };+ let last = strip.last().copied().unwrap_or(0.0);+ strip.push(last + self.widths[s as usize]);+ }+ }++ /// Show the sort indicator on source column `src` only.+ pub fn mark_sorted(&mut self, src: usize, sort: ColumnSort) {+ for (i, c) in self.cols.iter_mut().enumerate() {+ if c.sort.is_some() {+ c.sort = Some(if i == src { sort } else { ColumnSort::Default });+ }+ }+ }++ /// Visible columns.+ #[must_use]+ pub const fn len(&self) -> usize {+ self.order.len()+ }+ #[must_use]+ pub const fn is_empty(&self) -> bool {+ self.order.is_empty()+ }+ /// Pinned columns (the first `pinned()` view columns).+ #[must_use]+ pub const fn pinned(&self) -> usize {+ self.pinned+ }+ /// The delegate column at view index `v`.+ #[must_use]+ pub fn column(&self, v: usize) -> &Column {+ &self.cols[self.order[v] as usize]+ }+ /// Source index of view column `v`.+ #[must_use]+ pub fn src(&self, v: usize) -> usize {+ self.order[v] as usize+ }+ /// View index of source column `s`, if visible.+ #[must_use]+ pub fn view_of(&self, s: usize) -> Option<usize> {+ self.order.iter().position(|&o| o as usize == s)+ }+ #[must_use]+ pub fn width(&self, v: usize) -> f32 {+ self.widths[self.order[v] as usize]+ }+ /// All widths in view order.+ #[must_use]+ pub fn widths(&self) -> Vec<f32> {+ (0..self.len()).map(|v| self.width(v)).collect()+ }+ /// Width of the pinned strip.+ #[must_use]+ pub fn pinned_width(&self) -> f32 {+ self.xf.last().copied().unwrap_or(0.0)+ }+ /// Width of the scrolling strip (the horizontal scroll extent).+ #[must_use]+ pub fn scroll_width(&self) -> f32 {+ self.xs.last().copied().unwrap_or(0.0)+ }+ /// Left edges within the pinned strip, `pinned + 1` entries.+ #[must_use]+ pub fn pinned_edges(&self) -> &[f32] {+ &self.xf+ }+ /// Left edges within the scrolling strip (`len - pinned + 1` entries).+ #[must_use]+ pub fn scroll_edges(&self) -> &[f32] {+ &self.xs+ }+ /// Left edge of view column `v` in its strip.+ #[must_use]+ pub fn left(&self, v: usize) -> f32 {+ if v < self.pinned { self.xf[v] } else { self.xs[v - self.pinned] }+ }++ /// Set the width of view column `v`, limited to its min and max.+ /// Returns whether it changed.+ pub fn set_width(&mut self, v: usize, w: f32) -> bool {+ let s = self.order[v] as usize;+ let c = &self.cols[s];+ let w = c.clamp_width(w);+ if (w - self.widths[s]).abs() < f32::EPSILON {+ return false;+ }+ self.widths[s] = w;+ self.rebuild_edges();+ true+ }++ /// Move view column `from` so it ends at `to` (inside its own strip).+ /// Returns whether the order changed.+ pub fn move_to(&mut self, from: usize, to: usize) -> bool {+ let n = self.len();+ if from >= n || to >= n || from == to || (from < self.pinned) != (to < self.pinned) {+ return false;+ }+ let s = self.order.remove(from);+ self.order.insert(to, s);+ self.rebuild_edges();+ true+ }++ /// The view column at strip x (`x` measured from the strip's left+ /// edge), by bisection.+ #[must_use]+ pub fn at_x(&self, pinned: bool, x: f32) -> Option<usize> {+ let (edges, base) = if pinned { (&self.xf, 0) } else { (&self.xs, self.pinned) };+ let n = edges.len().saturating_sub(1);+ if n == 0 || x < 0.0 || x >= edges[n] {+ return None;+ }+ Some(base + edges[1..].partition_point(|&r| r <= x))+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ fn cols() -> Vec<Column> {+ vec![+ Column::new("a", "A").width(50.0_f32),+ Column::new("b", "B").width(30.0_f32).fixed_left(),+ Column::new("c", "C").width(20.0_f32),+ Column::new("d", "D").width(40.0_f32).visible(false),+ ]+ }++ #[test]+ fn pinned_first_hidden_skipped() {+ let l = ColumnLayout::new(cols());+ assert_eq!(l.len(), 3);+ assert_eq!(l.pinned(), 1);+ assert_eq!(l.column(0).key, "b");+ assert_eq!(l.pinned_width(), 30.0);+ assert_eq!(l.scroll_width(), 70.0);+ assert_eq!(l.left(2), 50.0);+ }++ #[test]+ fn resize_clamps_and_moves_edges() {+ let mut l = ColumnLayout::new(cols());+ assert!(l.set_width(1, 5.0));+ assert_eq!(l.width(1), 20.0);+ assert_eq!(l.scroll_width(), 40.0);+ assert!(l.set_width(1, 1e6));+ assert_eq!(l.width(1), 1200.0);+ assert!(!l.set_width(1, 1e6));+ }++ #[test]+ fn move_stays_in_strip() {+ let mut l = ColumnLayout::new(cols());+ assert!(!l.move_to(0, 1)); // pinned -> scrolling+ assert!(l.move_to(2, 1));+ assert_eq!(l.column(1).key, "c");+ assert_eq!(l.left(1), 0.0);+ assert_eq!(l.at_x(false, 5.0), Some(1));+ assert_eq!(l.at_x(false, 25.0), Some(2));+ assert_eq!(l.at_x(false, 70.0), None);+ assert_eq!(l.at_x(true, 29.9), Some(0));+ }++ #[test]+ fn reset_keeps_user_widths() {+ let mut l = ColumnLayout::new(cols());+ l.set_width(2, 77.0);+ l.reset(cols());+ assert_eq!(l.width(2), 77.0);+ }++ #[test]+ fn hostile_widths_cannot_poison_the_edges() {+ let cols = vec![+ Column::new("a", "A").width(f32::NAN),+ Column::new("b", "B").width(50.0_f32).min_width(500.0_f32).max_width(10.0_f32),+ Column::new("c", "C").width(f32::INFINITY),+ ];+ let mut l = ColumnLayout::new(cols);+ assert!(l.scroll_width().is_finite());+ assert!(l.set_width(0, f32::NAN) || l.width(0).is_finite());+ l.reset(vec![Column::new("b", "B").min_width(500.0_f32).max_width(10.0_f32)]);+ assert!(l.width(0).is_finite());+ assert!((0..l.len()).all(|v| l.left(v).is_finite()));+ }++ #[test]+ fn sort_cycle() {+ assert_eq!(ColumnSort::Default.next().next().next(), ColumnSort::Default);+ }+}diff --git a/bindings/rust/blenderui-table/src/event.rs b/bindings/rust/blenderui-table/src/event.rsnew file mode 100644index 0000000..ea69635--- /dev/null+++ b/bindings/rust/blenderui-table/src/event.rs@@ -0,0 +1,152 @@+//! The table's vocabulary: options, selection kinds, events, the visible range.++use std::ops::Range;++use crate::column::ColumnSort;++/// What is selected (gpui-component's `TableSelection`; the row is the+/// source row index, whatever the sort order).+#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]+pub enum TableSelection {+ #[default]+ None,+ Row(usize),+ Column(usize),+ Cell(usize, usize),+}++/// Events the table raises (gpui-component's `TableEvent`; rows are source+/// row indices, columns source column indices unless noted).+#[derive(Clone, Debug, PartialEq)]+pub enum TableEvent {+ SelectRow(usize),+ DoubleClickedRow(usize),+ SelectColumn(usize),+ SelectCell(usize, usize),+ DoubleClickedCell(usize, usize),+ /// A column was resized: all widths, view order.+ ColumnWidthsChanged(Vec<f32>),+ /// A column moved: from, to (view indices).+ MoveColumn(usize, usize),+ RightClickedRow(Option<usize>),+ RightClickedCell(usize, usize),+ ClearSelection,+ /// A header click sorted (source column, sort).+ Sorted(usize, ColumnSort),+ /// Ctrl+C: this text goes to the clipboard.+ Copied(String),+ /// A double click on a column's border asks the delegate to fit it+ /// (source column). Adapters answer it and do not forward it.+ FitColumn(usize),+}++/// Rows and columns in view (gpui-component's `TableVisibleRange`). Rows are+/// display rows, columns view columns.+#[derive(Clone, Debug, Default, PartialEq, Eq)]+pub struct TableVisibleRange {+ pub(crate) rows: Range<usize>,+ pub(crate) cols: Range<usize>,+}++impl TableVisibleRange {+ #[must_use]+ pub const fn rows(&self) -> &Range<usize> {+ &self.rows+ }++ #[must_use]+ pub const fn cols(&self) -> &Range<usize> {+ &self.cols+ }+}++/// Row height presets (gpui-component's `Size`).+#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]+pub enum Size {+ XSmall,+ Small,+ #[default]+ Medium,+ Large,+}++impl Size {+ #[must_use]+ pub const fn factor(self) -> f32 {+ match self {+ Self::XSmall => 0.8,+ Self::Small => 0.9,+ Self::Medium => 1.0,+ Self::Large => 1.25,+ }+ }+}++/// Table settings (the builder methods of `TableState` and `DataTable`).+#[derive(Copy, Clone, Debug)]+#[allow(clippy::struct_excessive_bools)]+pub struct TableOptions {+ pub sortable: bool,+ pub col_resizable: bool,+ pub col_movable: bool,+ pub row_selectable: bool,+ pub col_selectable: bool,+ pub cell_selectable: bool,+ /// The left index column (Blender's `draw_left_column_cell`).+ pub row_header: bool,+ pub select_on_modifier_click: bool,+ pub loop_selection: bool,+ pub stripe: bool,+ pub bordered: bool,+ pub size: Size,+ pub header_row_height: Option<f32>,+ /// Text size in logical pixels; `None`: 0.6 of the UI unit (Blender's ratio).+ pub text_size: Option<f32>,+ pub fixed_cols_border: bool,+ /// Vertical and horizontal scrollbars.+ pub scrollbars: (bool, bool),+}++impl Default for TableOptions {+ fn default() -> Self {+ Self {+ sortable: true,+ col_resizable: true,+ col_movable: true,+ row_selectable: true,+ col_selectable: false,+ cell_selectable: false,+ row_header: false,+ select_on_modifier_click: true,+ loop_selection: true,+ stripe: false,+ bordered: true,+ size: Size::Medium,+ header_row_height: None,+ text_size: None,+ fixed_cols_border: true,+ scrollbars: (true, true),+ }+ }+}++/// The builder methods of `TableState` (gpui-component's names), generated+/// once for every adapter: `table_option_builders!();` inside an `impl` block+/// of a type whose `self.opts` (directly or through `DerefMut`) is a [`TableOptions`].+#[macro_export]+macro_rules! table_option_builders {+ () => {+ $crate::table_option_builders!(@each+ loop_selection col_movable col_resizable sortable row_selectable+ select_on_modifier_click col_selectable cell_selectable row_header);+ };+ (@each $($name:ident)+) => {+ $(+ #[must_use]+ pub fn $name(mut self, on: bool) -> Self {+ self.opts.$name = on;+ self+ }+ )++ };+}diff --git a/bindings/rust/blenderui-table/src/fmt.rs b/bindings/rust/blenderui-table/src/fmt.rsnew file mode 100644index 0000000..29a384e--- /dev/null+++ b/bindings/rust/blenderui-table/src/fmt.rs@@ -0,0 +1,201 @@+//! Number formatting into a stack buffer: no heap allocation, no+//! `core::fmt` machinery on the hot path (Blender formats spreadsheet cells+//! into a small fixed buffer the same way, `spreadsheet_layout.cc`).++use std::fmt;++/// A fixed buffer a cell's text is formatted into. Large enough for any+/// integer and for floats up to 15 integer digits and 9 decimals.+#[derive(Clone, Debug)]+pub struct CellBuf {+ bytes: [u8; Self::CAP],+ len: usize,+}++impl Default for CellBuf {+ fn default() -> Self {+ Self::new()+ }+}++impl CellBuf {+ pub const CAP: usize = 48;++ #[must_use]+ pub const fn new() -> Self {+ Self { bytes: [0; Self::CAP], len: 0 }+ }++ pub const fn clear(&mut self) {+ self.len = 0;+ }++ /// The formatted text. Only whole UTF-8 sequences are ever written, so+ /// the check cannot fail; the empty string is the safe fallback.+ #[must_use]+ pub fn as_str(&self) -> &str {+ std::str::from_utf8(&self.bytes[..self.len]).unwrap_or("")+ }++ fn push_bytes(&mut self, s: &[u8]) {+ let n = s.len().min(Self::CAP - self.len);+ self.bytes[self.len..self.len + n].copy_from_slice(&s[..n]);+ self.len += n;+ }++ /// Write the decimal digits of `v`.+ pub fn push_u64(&mut self, mut v: u64) {+ let mut tmp = [0u8; 20];+ let mut i = tmp.len();+ loop {+ i -= 1;+ tmp[i] = b'0' + (v % 10) as u8;+ v /= 10;+ if v == 0 {+ break;+ }+ }+ self.push_bytes(&tmp[i..]);+ }++ pub fn push_i64(&mut self, v: i64) {+ if v < 0 {+ self.push_bytes(b"-");+ }+ self.push_u64(v.unsigned_abs());+ }++ /// `v` with exactly `decimals` digits after the point (at most 9),+ /// rounded half to even on the scaled value. `NaN`, `inf` and values+ /// beyond 15 integer digits use the standard formatter (the exponent+ /// form for huge values), still without heap allocation.+ pub fn push_f64(&mut self, v: f64, decimals: u8) {+ const POW10: [u64; 10] = [1, 10, 100, 1_000, 10_000, 100_000, 1_000_000, 10_000_000, 100_000_000, 1_000_000_000];+ let d = usize::from(decimals.min(9));+ let scaled = v.abs() * POW10[d] as f64;+ if v.is_finite() && scaled < 9.0e18 {+ let s = scaled.round_ties_even() as u64;+ // a negative value that rounds to zero prints without a sign+ if v.is_sign_negative() && s != 0 {+ self.push_bytes(b"-");+ }+ self.push_u64(s / POW10[d]);+ if d > 0 {+ self.push_bytes(b".");+ let frac = s % POW10[d];+ // zero-pad to `d` digits+ let digits = if frac == 0 { 1 } else { frac.ilog10() as usize + 1 };+ for _ in digits..d {+ self.push_bytes(b"0");+ }+ self.push_u64(frac);+ }+ } else {+ let _ = fmt::Write::write_fmt(self, format_args!("{v:e}"));+ }+ }+}++impl fmt::Write for CellBuf {+ fn write_str(&mut self, s: &str) -> fmt::Result {+ // never split a UTF-8 sequence when the buffer is full+ let mut n = s.len().min(Self::CAP - self.len);+ while !s.is_char_boundary(n) {+ n -= 1;+ }+ self.push_bytes(&s.as_bytes()[..n]);+ Ok(())+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ fn f(v: f64, d: u8) -> String {+ let mut b = CellBuf::new();+ b.push_f64(v, d);+ b.as_str().to_owned()+ }++ struct Rng(u64);+ impl Rng {+ fn next(&mut self) -> u64 {+ self.0 ^= self.0 << 13;+ self.0 ^= self.0 >> 7;+ self.0 ^= self.0 << 17;+ self.0+ }+ }++ #[test]+ fn integers_match_std() {+ let mut rng = Rng(7);+ let mut cases = vec![0i64, 1, -1, 9, 10, 99, 100, i64::MAX, i64::MIN, 1_000_000, -1_000_000];+ cases.extend((0..5000).map(|_| (rng.next() >> (rng.next() % 64)) as i64));+ for v in cases {+ let mut b = CellBuf::new();+ b.push_i64(v);+ assert_eq!(b.as_str(), v.to_string());+ }+ for v in [0u64, u64::MAX, 12345] {+ let mut b = CellBuf::new();+ b.push_u64(v);+ assert_eq!(b.as_str(), v.to_string());+ }+ }++ #[test]+ fn decimal_data_matches_std() {+ // k-digit decimals printed with k decimals must equal `format!`+ let mut rng = Rng(99);+ for _ in 0..20_000 {+ let d = (rng.next() % 7) as u8;+ let scale = 10f64.powi(i32::from(d));+ let int = (rng.next() % 2_000_000_000) as i64 - 1_000_000_000;+ let v = int as f64 / scale;+ assert_eq!(f(v, d), format!("{v:.prec$}", prec = usize::from(d)), "v {v} d {d}");+ }+ }++ #[test]+ fn arbitrary_floats_are_within_one_unit_of_std() {+ let mut rng = Rng(5);+ for _ in 0..20_000 {+ let v = (rng.next() as f64 / u64::MAX as f64 - 0.5) * 1e6;+ for d in [0u8, 1, 2, 3, 6] {+ let (a, b) = (f(v, d), format!("{v:.prec$}", prec = usize::from(d)));+ let (pa, pb): (f64, f64) = (a.parse().unwrap(), b.parse().unwrap());+ assert!((pa - pb).abs() <= 1.0001 / 10f64.powi(i32::from(d)), "{a} vs {b}");+ }+ }+ }++ #[test]+ fn specials_and_huge() {+ assert_eq!(f(0.0, 2), "0.00");+ assert_eq!(f(-0.0, 2), "0.00");+ assert_eq!(f(-0.001, 2), "0.00");+ assert_eq!(f(-1.5, 0), "-2");+ assert_eq!(f(2.5, 0), "2");+ assert_eq!(f(f64::NAN, 2), "NaN");+ assert_eq!(f(f64::INFINITY, 2), "inf");+ assert_eq!(f(f64::NEG_INFINITY, 2), "-inf");+ assert_eq!(f(1e300, 2), "1e300");+ assert_eq!(f(0.5, 200), f(0.5, 9));+ assert!(f(1e18, 3).len() < CellBuf::CAP);+ }++ #[test]+ fn full_buffer_truncates_on_a_char_boundary() {+ use std::fmt::Write as _;+ let mut b = CellBuf::new();+ for _ in 0..40 {+ b.write_str("\u{e9}").unwrap();+ }+ assert_eq!(b.as_str().len(), 48);+ assert!(b.as_str().chars().all(|c| c == '\u{e9}'));+ b.clear();+ assert_eq!(b.as_str(), "");+ }+}diff --git a/bindings/rust/blenderui-table/src/geometry.rs b/bindings/rust/blenderui-table/src/geometry.rsnew file mode 100644index 0000000..86927cb--- /dev/null+++ b/bindings/rust/blenderui-table/src/geometry.rs@@ -0,0 +1,216 @@+//! The table's rectangles for a given size and where a point falls: one+//! source of truth for painting and hit testing. Logical pixels, relative to+//! the table's top-left.+//!+//! Layout metrics are Blender's spreadsheet: row = `UI_UNIT_Y`, header row =+//! `1.1 * UI_UNIT_Y`, index column = `2 * UI_UNIT_X` (`SpreadsheetDrawer`+//! constructor in `spreadsheet_draw.cc`), all scaled by the UI scale.++use crate::geom::Point;+use crate::model::TableModel;+use crate::visible::{max_scroll, visible_cols, visible_rows};++use crate::event::TableVisibleRange;++/// The table's rectangles.+#[derive(Copy, Clone, Debug)]+pub struct Geometry {+ pub w: f32,+ pub h: f32,+ pub unit: f32,+ pub row_h: f32,+ pub header_h: f32,+ pub groups_h: f32,+ /// Top of the rows.+ pub top: f32,+ pub index_w: f32,+ pub pinned_w: f32,+ /// Left edge of the scrolling columns.+ pub x0: f32,+ pub body_h: f32,+ pub view_w: f32,+ pub bar: f32,+}++/// Where a point in the table is.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub enum Hit {+ None,+ Header(usize),+ /// The border after view column `v` (a resize handle).+ Border(usize),+ Group,+ Index(usize),+ /// Display row and view column.+ Cell(usize, usize),+ /// A vertical scrollbar; true over its thumb.+ VBar(bool),+ HBar(bool),+}++/// What the user can drag a pointer over, 4 px of slack to grab a border.+const GRAB: f32 = 4.0;++impl TableModel {+ #[must_use]+ pub fn geometry(&self, w: f32, h: f32) -> Geometry {+ let unit = self.unit;+ let row_h = (unit * self.opts.size.factor()).round().max(1.0);+ let header_h = self.opts.header_row_height.unwrap_or(unit * 1.1);+ let groups_h = self.groups.as_ref().map_or(0.0, |g| g.len() as f32 * header_h);+ let top = groups_h + header_h;+ // Blender: 2 * UI_UNIT_X; wider when the row numbers need it+ let digits = self.total.max(1).ilog10() as f32 + 1.0;+ let index_w = if self.opts.row_header { (unit * 2.0).max(digits * unit * 0.38 + unit * 0.7) } else { 0.0 };+ let pinned_w = self.layout.pinned_width();+ let x0 = index_w + pinned_w;+ Geometry {+ w,+ h,+ unit,+ row_h,+ header_h,+ groups_h,+ top,+ index_w,+ pinned_w,+ x0,+ body_h: (h - top).max(0.0),+ view_w: (w - x0).max(0.0),+ bar: (unit * 0.45).max(6.0),+ }+ }++ /// The geometry for the table's current size.+ #[must_use]+ pub fn geo(&self) -> Geometry {+ self.geometry(self.size.0, self.size.1)+ }++ /// Rows and columns in view for `g` (the same functions the painter uses).+ #[must_use]+ pub fn compute_visible(&self, g: &Geometry) -> TableVisibleRange {+ let rows = visible_rows(self.scroll.1, f64::from(g.row_h), f64::from(g.body_h), self.rows());+ let sx = self.scroll.0 as f32;+ let cols = visible_cols(self.layout.scroll_edges(), sx, sx + g.view_w);+ let p = self.layout.pinned();+ TableVisibleRange { rows, cols: cols.start + p..cols.end + p }+ }++ /// Table-x of the left edge of view column `v`.+ #[must_use]+ pub fn col_x(&self, g: &Geometry, v: usize) -> f32 {+ if v < self.layout.pinned() {+ g.index_w + self.layout.left(v)+ } else {+ g.x0 + self.layout.left(v) - self.scroll.0 as f32+ }+ }++ /// The view column under table-x `x` (pinned columns cover scrolled ones).+ #[must_use]+ pub fn col_at(&self, g: &Geometry, x: f32) -> Option<usize> {+ if x < g.index_w {+ None+ } else if x < g.x0 {+ self.layout.at_x(true, x - g.index_w)+ } else {+ self.layout.at_x(false, x - g.x0 + self.scroll.0 as f32)+ }+ }++ /// Table-y of the top of display row `r` for the current scroll.+ #[must_use]+ pub fn row_top(&self, g: &Geometry, r: usize) -> f32 {+ g.top + (r as f64 * f64::from(g.row_h) - self.scroll.1) as f32+ }++ /// The vertical thumb: top and height.+ #[must_use]+ pub fn vthumb(&self, g: &Geometry) -> Option<(f32, f32)> {+ let content = self.rows() as f64 * f64::from(g.row_h);+ let view = f64::from(g.body_h);+ if !self.opts.scrollbars.0 || content <= view || view <= 0.0 {+ return None;+ }+ let th = ((view * view / content) as f32).max(g.unit);+ let range = max_scroll(self.rows(), f64::from(g.row_h), view);+ let ty = g.top + (f64::from(g.body_h - th) * (self.scroll.1 / range)) as f32;+ Some((ty, th))+ }++ /// The horizontal thumb: left and width.+ #[must_use]+ pub fn hthumb(&self, g: &Geometry) -> Option<(f32, f32)> {+ let content = self.layout.scroll_width();+ if !self.opts.scrollbars.1 || content <= g.view_w || g.view_w <= 0.0 {+ return None;+ }+ let tw = (g.view_w * g.view_w / content).max(g.unit);+ let range = f64::from(content - g.view_w);+ let tx = g.x0 + (f64::from(g.view_w - tw) * (self.scroll.0 / range)) as f32;+ Some((tx, tw))+ }++ /// What is at table-relative point `p`.+ #[must_use]+ pub fn hit(&self, p: Point) -> Hit {+ let g = self.geo();+ let (x, y) = (p.x, p.y);+ if x < 0.0 || y < 0.0 || x >= g.w || y >= g.h {+ return Hit::None;+ }+ if y >= g.top {+ if let (Some((ty, th)), true) = (self.vthumb(&g), x >= g.w - g.bar) {+ return Hit::VBar(y >= ty && y < ty + th);+ }+ if let (Some((tx, tw)), true) = (self.hthumb(&g), y >= g.h - g.bar && x >= g.x0) {+ return Hit::HBar(x >= tx && x < tx + tw);+ }+ }+ if y < g.groups_h {+ return Hit::Group;+ }+ if y < g.top {+ let Some(v) = self.col_at(&g, x) else { return Hit::None };+ let (l, w) = (self.col_x(&g, v), self.layout.width(v));+ if l + w - x <= GRAB {+ return Hit::Border(v);+ }+ if x - l <= GRAB && v > 0 && (v != self.layout.pinned() || g.pinned_w > 0.0) {+ return Hit::Border(v - 1);+ }+ return Hit::Header(v);+ }+ let row = ((f64::from(y - g.top) + self.scroll.1) / f64::from(g.row_h)).floor();+ if row < 0.0 || row >= self.rows() as f64 {+ return Hit::None;+ }+ let row = row as usize;+ if x < g.index_w {+ return Hit::Index(row);+ }+ match self.col_at(&g, x) {+ Some(v) => Hit::Cell(row, v),+ None => Hit::None,+ }+ }++ /// Header borders to put a resize cursor over: (x, y, height) in table+ /// coordinates, for the resizable columns in view.+ #[must_use]+ pub fn header_handles(&self) -> Vec<(f32, f32, f32)> {+ let g = self.geo();+ if !self.opts.col_resizable {+ return Vec::new();+ }+ let vis = self.compute_visible(&g);+ let pinned = self.layout.pinned();+ (0..pinned)+ .chain(vis.cols)+ .filter(|&v| self.layout.column(v).resizable)+ .map(|v| (self.col_x(&g, v) + self.layout.width(v), g.groups_h, g.header_h))+ .filter(|&(x, _, _)| x >= g.index_w && x <= g.w - 4.0)+ .collect()+ }+}diff --git a/bindings/rust/blenderui-table/src/input.rs b/bindings/rust/blenderui-table/src/input.rsnew file mode 100644index 0000000..66f0ff2--- /dev/null+++ b/bindings/rust/blenderui-table/src/input.rs@@ -0,0 +1,95 @@+//! Input the table understands, in framework-neutral form. Adapters+//! translate their events into these; the logic that reacts to them is in+//! [`crate::interact`].++/// Modifier keys held during an event.+#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]+pub struct Mods {+ pub shift: bool,+ pub control: bool,+ pub alt: bool,+}++/// A pointer button.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub enum Button {+ Left,+ Right,+ Middle,+}++/// The keys a table reacts to.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub enum Key {+ Up,+ Down,+ Left,+ Right,+ PageUp,+ PageDown,+ Home,+ End,+ Escape,+ /// `a` (with control: select all)+ A,+ /// `c` (with control: copy)+ C,+ Other,+}++impl Key {+ /// A key from its name as the frameworks spell it: Blender-style+ /// (`Down`, `Prior`, `Next`) and gpui-style (`down`, `pageup`,+ /// `pagedown`), any case.+ #[must_use]+ pub fn parse(name: &str) -> Self {+ const NAMES: [(&str, Key); 17] = [+ ("up", Key::Up),+ ("arrowup", Key::Up),+ ("down", Key::Down),+ ("arrowdown", Key::Down),+ ("left", Key::Left),+ ("arrowleft", Key::Left),+ ("right", Key::Right),+ ("arrowright", Key::Right),+ ("pageup", Key::PageUp),+ ("prior", Key::PageUp),+ ("pagedown", Key::PageDown),+ ("next", Key::PageDown),+ ("home", Key::Home),+ ("end", Key::End),+ ("escape", Key::Escape),+ ("cancel", Key::Escape),+ ("esc", Key::Escape),+ ];+ if let Some(&(_, k)) = NAMES.iter().find(|(n, _)| n.eq_ignore_ascii_case(name)) {+ return k;+ }+ if name.eq_ignore_ascii_case("a") {+ Self::A+ } else if name.eq_ignore_ascii_case("c") {+ Self::C+ } else {+ Self::Other+ }+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn both_spellings_parse() {+ assert_eq!(Key::parse("Down"), Key::Down);+ assert_eq!(Key::parse("down"), Key::Down);+ assert_eq!(Key::parse("Next"), Key::PageDown);+ assert_eq!(Key::parse("pagedown"), Key::PageDown);+ assert_eq!(Key::parse("Prior"), Key::PageUp);+ assert_eq!(Key::parse("A"), Key::A);+ assert_eq!(Key::parse("c"), Key::C);+ assert_eq!(Key::parse("Cancel"), Key::Escape);+ assert_eq!(Key::parse("F13"), Key::Other);+ assert_eq!(Key::parse(""), Key::Other);+ }+}diff --git a/bindings/rust/blenderui-table/src/interact.rs b/bindings/rust/blenderui-table/src/interact.rsnew file mode 100644index 0000000..8d60f18--- /dev/null+++ b/bindings/rust/blenderui-table/src/interact.rs@@ -0,0 +1,279 @@+//! How pointer, wheel and keyboard input change a [`TableModel`]: the one+//! implementation of the table's interaction, shared by every adapter.+//! Positions are relative to the table's top-left. Handlers return whether+//! the table needs a redraw; results the framework must act on (hooks, the+//! clipboard) are queued as [`TableEvent`]s.++use crate::cell::CellSource;+use crate::column::ColumnSort;+use crate::event::TableEvent;+use crate::geom::Point;+use crate::geometry::Hit;+use crate::input::{Button, Key, Mods};+use crate::model::{Drag, TableModel};+use crate::visible::max_scroll;++/// Pointer travel before a header press becomes a column move.+const MOVE_SLOP: f32 = 4.0;++impl TableModel {+ /// Pointer pressed at `p`; `clicks` is the click count (2: double click).+ pub fn pointer_down(&mut self, p: Point, button: Button, mods: Mods, clicks: usize) {+ let hit = self.hit(p);+ let g = self.geo();+ if button == Button::Right {+ self.right_click(hit);+ return;+ }+ if button != Button::Left {+ return;+ }+ match hit {+ Hit::VBar(on) => {+ let (ty, th) = self.vthumb(&g).unwrap_or((0.0, 0.0));+ let grab = if on { p.y - ty } else { th / 2.0 };+ self.drag = Drag::VThumb { grab };+ self.drag_thumb(p);+ }+ Hit::HBar(on) => {+ let (tx, tw) = self.hthumb(&g).unwrap_or((0.0, 0.0));+ let grab = if on { p.x - tx } else { tw / 2.0 };+ self.drag = Drag::HThumb { grab };+ self.drag_thumb(p);+ }+ Hit::Border(v) => {+ if clicks >= 2 {+ self.events.push(TableEvent::FitColumn(self.layout.src(v)));+ } else if self.opts.col_resizable && self.layout.column(v).resizable {+ self.drag = Drag::Resize { v, x: p.x, w: self.layout.width(v) };+ }+ }+ Hit::Header(v) => self.drag = Drag::Header { v, x: p.x, moved: false, to: v },+ Hit::Index(r) => self.click_row(r, None, mods, clicks),+ Hit::Cell(r, v) => self.click_row(r, Some(v), mods, clicks),+ Hit::Group | Hit::None => {}+ }+ }++ fn right_click(&mut self, hit: Hit) {+ match hit {+ Hit::Cell(r, _) | Hit::Index(r) => {+ let v = if let Hit::Cell(_, v) = hit { Some(v) } else { None };+ if !self.sel.contains(r) {+ self.sel.select_only(r);+ }+ let row = self.mask.get(r);+ self.right_clicked = Some((row, v.map(|v| self.layout.src(v))));+ self.events.push(match v {+ Some(v) if self.opts.cell_selectable => TableEvent::RightClickedCell(row, self.layout.src(v)),+ _ => TableEvent::RightClickedRow(Some(row)),+ });+ }+ _ => {+ self.right_clicked = None;+ self.events.push(TableEvent::RightClickedRow(None));+ }+ }+ }++ fn click_row(&mut self, r: usize, col: Option<usize>, mods: Mods, clicks: usize) {+ let row = self.mask.get(r);+ self.right_clicked = None;+ let cell_mode = self.opts.cell_selectable && col.is_some_and(|v| self.layout.column(v).selectable);+ if cell_mode {+ let c = self.layout.src(col.unwrap_or(0));+ self.sel.select_only(r);+ self.sel_col = None;+ self.sel_cell = Some((row, c));+ self.events.push(TableEvent::SelectCell(row, c));+ if clicks >= 2 {+ self.events.push(TableEvent::DoubleClickedCell(row, c));+ }+ } else if self.opts.row_selectable {+ let multi = self.opts.select_on_modifier_click;+ self.sel.click(r, if multi { mods } else { Mods::default() });+ self.sel_col = None;+ self.sel_cell = None;+ self.events.push(TableEvent::SelectRow(row));+ if clicks >= 2 {+ self.events.push(TableEvent::DoubleClickedRow(row));+ }+ }+ }++ fn drag_thumb(&mut self, p: Point) {+ let g = self.geo();+ match self.drag {+ Drag::VThumb { grab } => {+ if let Some((_, th)) = self.vthumb(&g) {+ let range = max_scroll(self.rows(), f64::from(g.row_h), f64::from(g.body_h));+ let t = f64::from(p.y - grab - g.top) / f64::from((g.body_h - th).max(1.0));+ self.scroll.1 = t.clamp(0.0, 1.0) * range;+ self.clamp_scroll();+ }+ }+ Drag::HThumb { grab } => {+ if let Some((_, tw)) = self.hthumb(&g) {+ let range = f64::from(self.layout.scroll_width() - g.view_w);+ let t = f64::from(p.x - grab - g.x0) / f64::from((g.view_w - tw).max(1.0));+ self.scroll.0 = t.clamp(0.0, 1.0) * range;+ self.clamp_scroll();+ }+ }+ _ => {}+ }+ }++ /// Pointer moved to `p`. Returns whether to redraw.+ pub fn pointer_move(&mut self, p: Point) -> bool {+ let g = self.geo();+ match self.drag {+ Drag::Resize { v, x, w } => {+ if self.layout.set_width(v, w + p.x - x) {+ self.widths_changed();+ return true;+ }+ }+ Drag::Header { v, x, moved, .. } => {+ let col = self.layout.column(v);+ if (moved || (p.x - x).abs() > MOVE_SLOP) && self.opts.col_movable && col.movable {+ // Blender's column move: the target is the column under the pointer+ let to = self.col_at(&g, p.x.max(g.index_w)).unwrap_or(v);+ let to = if (to < self.layout.pinned()) == (v < self.layout.pinned()) { to } else { v };+ self.drag = Drag::Header { v, x, moved: true, to };+ return true;+ }+ }+ Drag::VThumb { .. } | Drag::HThumb { .. } => {+ self.drag_thumb(p);+ return true;+ }+ Drag::None => {}+ }+ let h = match self.hit(p) {+ Hit::Cell(r, _) | Hit::Index(r) => Some(r),+ _ => None,+ };+ if h == self.hover {+ return false;+ }+ self.hover = h;+ true+ }++ /// Pointer released: finishes drags, and a header press that didn't move+ /// is a click (sort, or select the column). `by_mask` says whether a sort+ /// reorders the row mask (false: the data sorts itself).+ pub fn pointer_up<S: CellSource + ?Sized>(&mut self, src: &S, by_mask: bool) {+ let drag = std::mem::replace(&mut self.drag, Drag::None);+ let Drag::Header { v, moved, to, .. } = drag else { return };+ if moved {+ if self.layout.move_to(v, to) {+ self.events.push(TableEvent::MoveColumn(v, to));+ }+ return;+ }+ let col = self.layout.column(v);+ let source = self.layout.src(v);+ if self.opts.sortable && col.sort.is_some() {+ let next = col.sort.map_or(ColumnSort::Ascending, ColumnSort::next);+ self.sort_by(src, source, next, by_mask);+ } else if self.opts.col_selectable && col.selectable {+ self.set_selected_col(source);+ }+ }++ /// Pixels a wheel of `lines` > 0 (up) scrolls: three rows per line,+ /// negative when scrolling up.+ #[must_use]+ pub fn wheel_pixels(&self, lines: f32) -> f64 {+ f64::from(-lines) * f64::from(self.geo().row_h) * 3.0+ }++ /// The display row a vertical key moves to from `active`.+ fn nav_target(&self, key: Key, shift: bool, active: Option<usize>, page: usize) -> Option<usize> {+ let rows = self.rows();+ let last = rows.saturating_sub(1);+ let wrap = self.opts.loop_selection && !shift;+ match key {+ Key::Down => Some(active.map_or(0, |a| if a + 1 < rows { a + 1 } else if wrap { 0 } else { a })),+ Key::Up => Some(active.map_or(last, |a| if a > 0 { a - 1 } else if wrap { last } else { 0 })),+ Key::PageDown => Some(active.map_or(0, |a| (a + page).min(last))),+ Key::PageUp => Some(active.map_or(0, |a| a.saturating_sub(page))),+ Key::Home => Some(0),+ Key::End => Some(last),+ _ => None,+ }+ }++ /// A key while the table has focus: arrows, PageUp/PageDown, Home/End,+ /// Ctrl+A (select all), Ctrl+C (copy as TSV), Escape. Returns whether it+ /// was handled.+ pub fn key_down<S: CellSource + ?Sized>(&mut self, key: Key, mods: Mods, src: &S) -> bool {+ let rows = self.rows();+ let g = self.geo();+ let page = ((g.body_h / g.row_h).floor() as usize).max(1);+ if let (Some(t), true) = (self.nav_target(key, mods.shift, self.sel.active(), page), rows > 0) {+ self.sel.move_to(t, mods.shift && self.opts.select_on_modifier_click);+ self.sel_col = None;+ if let Some((_, c)) = self.sel_cell {+ self.sel_cell = Some((self.mask.get(t), c));+ }+ self.show_view_row(t);+ self.events.push(TableEvent::SelectRow(self.mask.get(t)));+ return true;+ }+ match key {+ Key::Left | Key::Right if self.opts.cell_selectable || self.opts.col_selectable => {+ self.move_column_selection(key == Key::Right);+ true+ }+ Key::Escape => {+ self.clear_selection();+ true+ }+ Key::A if mods.control && self.opts.row_selectable => {+ self.sel.select_all(rows);+ self.sel_col = None;+ self.sel_cell = None;+ self.events.push(TableEvent::SelectRow(self.sel.active().map_or(0, |a| self.mask.get(a))));+ true+ }+ Key::C if mods.control => {+ let text = self.selection_text(src);+ if !text.is_empty() {+ self.events.push(TableEvent::Copied(text));+ }+ true+ }+ _ => false,+ }+ }++ /// Left / Right with a column or cell selection mode: move it one column.+ fn move_column_selection(&mut self, right: bool) {+ let n = self.layout.len();+ if n == 0 {+ return;+ }+ let cur = self.sel_cell.map(|(_, c)| c).or(self.sel_col).and_then(|s| self.layout.view_of(s));+ let wrap = self.opts.loop_selection;+ let next = match (cur, right) {+ (None, _) => 0,+ (Some(c), true) => if c + 1 < n { c + 1 } else if wrap { 0 } else { c },+ (Some(c), false) => if c > 0 { c - 1 } else if wrap { n - 1 } else { 0 },+ };+ let src = self.layout.src(next);+ if self.opts.cell_selectable {+ let r = self.sel.active().map_or(0, |a| self.mask.get(a));+ self.sel_cell = Some((r, src));+ self.events.push(TableEvent::SelectCell(r, src));+ } else {+ self.sel_col = Some(src);+ self.events.push(TableEvent::SelectColumn(src));+ }+ if next >= self.layout.pinned() {+ self.show_view_col(next);+ }+ }+}diff --git a/bindings/rust/blenderui-table/src/lib.rs b/bindings/rust/blenderui-table/src/lib.rsnew file mode 100644index 0000000..a512a4c--- /dev/null+++ b/bindings/rust/blenderui-table/src/lib.rs@@ -0,0 +1,62 @@+//! A framework-independent, virtualized data table: the logic once, for every+//! UI framework.+//!+//! The design is Blender's spreadsheet editor+//! (`source/blender/editors/space_spreadsheet`) with Blender's other UI+//! optimizations:+//!+//! | Blender | here |+//! |---|---|+//! | `get_visible_rows`, column culling in `spreadsheet_draw.cc` | [`visible`]: O(visible) range math in `f64`, column bisection |+//! | `IndexMask`, `spreadsheet_row_filter.cc` | [`mask::RowMask`] and [`sort`]: sorting and filtering never reorder data |+//! | `GVArray` column values | [`cell::CellSource`] / [`cell::Cell`]: typed, lazy, formatted into stack buffers ([`fmt`]) |+//! | `UI_widgetbase_draw_cache` (batched quads) | [`paint`]: a run of selected rows is one quad |+//! | BLF glyph cache | [`text_cache::TextCache`]: bounded, generation-tagged text-run cache |+//!+//! Layering: [`model::TableModel`] holds all state and is driven by+//! [`interact`] (input) and [`paint`] (output through [`paint::PaintSink`]).+//! A framework adapter owns a model next to its data, translates its events+//! into [`input`] types, implements `PaintSink`, and answers the+//! [`event::TableEvent`]s the model queues (hooks, clipboard). `std` only.++// Deliberate: layout math compares f32 sentinels exactly, the geometry uses short+// names (x, y, w, h, l, r), `u64 as i64` keys flip the sign bit on purpose.+#![allow(clippy::float_cmp, clippy::many_single_char_names, clippy::cast_possible_wrap, clippy::items_after_statements)]++pub mod cell;+pub mod column;+pub mod event;+pub mod fmt;+pub mod geometry;+pub mod input;+pub mod interact;+pub mod mask;+pub mod model;+pub mod paint;+pub mod selection;+pub mod state;+pub mod sort;+pub use blenderui_paint::{geom, text_cache};+pub mod vec_table;+pub mod visible;++#[cfg(test)]+mod alloc_probe;+#[cfg(test)]+mod test_util;++pub use cell::{Cell, CellKind, CellSource, SortKind};+pub use column::{Column, ColumnFixed, ColumnGroup, ColumnLayout, ColumnSort, Text, TextAlign};+pub use event::{Size, TableEvent, TableOptions, TableSelection, TableVisibleRange};+pub use fmt::CellBuf;+pub use geom::{Point, Rect, Rgba};+pub use geometry::{Geometry, Hit};+pub use input::{Button, Key, Mods};+pub use mask::RowMask;+pub use model::{Drag, FrameReport, TableModel};+pub use paint::{paint_table, with_scratch, PaintScratch, PaintSink, Palette};+pub use selection::RowSelection;+pub use state::{Host, TableCore};+pub use text_cache::TextCache;+pub use vec_table::VecTable;+pub use visible::{clamp_scroll, max_scroll, scroll_to_show, visible_cols, visible_rows};diff --git a/bindings/rust/blenderui-table/src/mask.rs b/bindings/rust/blenderui-table/src/mask.rsnew file mode 100644index 0000000..03f8000--- /dev/null+++ b/bindings/rust/blenderui-table/src/mask.rs@@ -0,0 +1,141 @@+//! Row masks: Blender's `IndexMask` for tables. Sorting and filtering never+//! copy rows, they only produce the list of row indices to show, in order+//! (`spreadsheet_row_filter.cc` builds an `IndexMask` the same way).+//!+//! A mask is either the identity (every row, no storage) or a permutation /+//! subset in a `Vec<u32>`. The sorts that build one live in [`crate::sort`].++use std::cmp::Ordering;++/// The data rows shown, in display order.+#[derive(Clone, Debug, PartialEq, Eq, Default)]+pub enum RowMask {+ /// Rows `0..n` in order: no storage.+ #[default]+ Identity,+ /// Explicit data row indices.+ Indices(Vec<u32>),+}++impl RowMask {+ /// The data row shown at display row `view_row`.+ #[inline]+ #[must_use]+ pub fn get(&self, view_row: usize) -> usize {+ match self {+ Self::Identity => view_row,+ Self::Indices(v) => v[view_row] as usize,+ }+ }++ /// Number of rows shown given `tot` data rows.+ #[inline]+ #[must_use]+ pub const fn len(&self, tot: usize) -> usize {+ match self {+ Self::Identity => tot,+ Self::Indices(v) => v.len(),+ }+ }++ /// Whether no row is shown given `tot` data rows.+ #[must_use]+ pub const fn is_empty(&self, tot: usize) -> bool {+ self.len(tot) == 0+ }++ /// The row indices, `None` for the identity.+ #[must_use]+ pub fn indices(&self) -> Option<&[u32]> {+ match self {+ Self::Identity => None,+ Self::Indices(v) => Some(v),+ }+ }++ /// The display row showing data row `row` (linear for an index list).+ #[must_use]+ pub fn position_of(&self, row: usize, tot: usize) -> Option<usize> {+ match self {+ Self::Identity => (row < tot).then_some(row),+ Self::Indices(v) => v.iter().position(|&r| r as usize == row),+ }+ }++ /// The rows of `self` (of `tot` data rows) that satisfy `keep`, in order+ /// (Blender's `IndexMask::from_predicate`).+ #[must_use]+ pub fn filtered(&self, tot: usize, keep: impl Fn(usize) -> bool) -> Self {+ let n = self.len(tot);+ Self::Indices((0..n).map(|i| self.get(i)).filter(|&r| keep(r)).map(|r| r as u32).collect())+ }++ /// The rows of `self` ordered by `cmp` (ties keep their order). Large+ /// masks sort on every core.+ #[must_use]+ pub fn sorted(&self, tot: usize, cmp: impl Fn(u32, u32) -> Ordering + Sync) -> Self {+ let mut v = self.to_vec(tot);+ crate::sort::sort_stable(&mut v, &|&a, &b| cmp(a, b));+ Self::Indices(v)+ }++ /// The row indices as a vector (`0..tot` for the identity).+ #[must_use]+ pub fn to_vec(&self, tot: usize) -> Vec<u32> {+ match self {+ Self::Identity => (0..tot as u32).collect(),+ Self::Indices(v) => v.clone(),+ }+ }+}++#[cfg(test)]+mod tests {+ use super::*;+ use crate::test_util::Rng;++ #[test]+ fn sort_equals_naive_reference() {+ for (seed, n) in [(1u64, 0usize), (2, 1), (3, 100), (4, 5000), (5, 70_000), (6, 200_001)] {+ let mut rng = Rng::new(seed);+ let keys: Vec<u32> = (0..n).map(|_| (rng.next() % 1000) as u32).collect(); // many ties+ let cmp = |a: u32, b: u32| keys[a as usize].cmp(&keys[b as usize]);+ let mask = RowMask::Identity.sorted(n, cmp);+ let mut naive: Vec<u32> = (0..n as u32).collect();+ naive.sort_by(|&a, &b| cmp(a, b));+ assert_eq!(mask.indices().unwrap(), &naive[..], "seed {seed} n {n}");+ }+ }++ #[test]+ fn filter_then_sort_equals_naive() {+ let n = 50_000;+ let mut rng = Rng::new(77);+ let keys: Vec<u32> = (0..n).map(|_| (rng.next() % 5000) as u32).collect();+ let m = RowMask::Identity.filtered(n, |r| keys[r].is_multiple_of(3));+ let m = m.sorted(n, |a, b| keys[b as usize].cmp(&keys[a as usize]));+ let mut naive: Vec<u32> = (0..n as u32).filter(|&r| keys[r as usize].is_multiple_of(3)).collect();+ naive.sort_by(|&a, &b| keys[b as usize].cmp(&keys[a as usize]));+ assert_eq!(m.indices().unwrap(), &naive[..]);+ assert_eq!(m.len(n), naive.len());+ assert_eq!(m.get(0), naive[0] as usize);+ }++ #[test]+ fn identity_is_free() {+ let m = RowMask::Identity;+ assert_eq!(m.get(41), 41);+ assert_eq!(m.len(7), 7);+ assert!(m.indices().is_none());+ assert_eq!(m.position_of(3, 7), Some(3));+ assert_eq!(m.position_of(7, 7), None);+ assert!(RowMask::Indices(vec![]).is_empty(9));+ }++ #[test]+ fn position_of_finds_the_display_row() {+ let m = RowMask::Indices(vec![5, 2, 9]);+ assert_eq!(m.position_of(9, 10), Some(2));+ assert_eq!(m.position_of(3, 10), None);+ }+}diff --git a/bindings/rust/blenderui-table/src/model.rs b/bindings/rust/blenderui-table/src/model.rsnew file mode 100644index 0000000..8199c05--- /dev/null+++ b/bindings/rust/blenderui-table/src/model.rs@@ -0,0 +1,550 @@+//! [`TableModel`]: everything a table remembers (columns, row mask, sort,+//! selection, scroll, size) and the operations on it, with no framework in+//! sight. Adapters own a model next to their data, feed it input+//! ([`crate::interact`]) and size ([`TableModel::begin_frame`]), and draw it+//! ([`crate::paint`]).+//!+//! Where a framework must be called (a delegate hook, the clipboard), the+//! model queues a [`TableEvent`] and the adapter answers it after the call:+//! the model never calls out.++use std::ops::Range;++use crate::cell::CellSource;+use crate::column::{Column, ColumnGroup, ColumnLayout, ColumnSort};+use crate::event::{TableEvent, TableOptions, TableSelection, TableVisibleRange};+use crate::mask::RowMask;+use crate::selection::RowSelection;+use crate::sort::sorted_by_column;+use crate::visible::{clamp_scroll, scroll_to_show};++/// A pointer drag in progress.+#[derive(Copy, Clone, Debug, PartialEq)]+pub enum Drag {+ None,+ /// Resizing view column `v` from its width when grabbed.+ Resize { v: usize, x: f32, w: f32 },+ /// A header pressed; becomes a column move after a few pixels.+ Header { v: usize, x: f32, moved: bool, to: usize },+ VThumb { grab: f32 },+ HThumb { grab: f32 },+}++/// What [`TableModel::begin_frame`] found changed.+#[derive(Clone, Debug, Default, PartialEq, Eq)]+pub struct FrameReport {+ /// The visible display rows, when they changed.+ pub rows_changed: Option<Range<usize>>,+ /// The visible view columns, when they changed.+ pub cols_changed: Option<Range<usize>>,+ /// Rows below the last visible one (for "load more").+ pub rows_left: usize,+}++/// The table. See the module docs.+pub struct TableModel {+ pub(crate) layout: ColumnLayout,+ pub(crate) mask: RowMask,+ filter: RowMask,+ /// Rows in the data source.+ pub(crate) total: usize,+ /// Settings; change them freely between frames.+ pub opts: TableOptions,+ pub(crate) sel: RowSelection,+ pub(crate) sel_col: Option<usize>,+ pub(crate) sel_cell: Option<(usize, usize)>,+ pub(crate) right_clicked: Option<(usize, Option<usize>)>,+ pub(crate) sort: Option<(usize, ColumnSort)>,+ /// Scroll offset in pixels (x, y), `f64` so a billion rows scroll exactly.+ pub(crate) scroll: (f64, f64),+ /// Width and height.+ pub(crate) size: (f32, f32),+ pub(crate) unit: f32,+ pub(crate) scale: f32,+ pub(crate) hover: Option<usize>,+ pub(crate) drag: Drag,+ visible: TableVisibleRange,+ pub(crate) groups: Option<Vec<Vec<ColumnGroup>>>,+ pub(crate) loading: bool,+ pub(crate) events: Vec<TableEvent>,+}++impl Default for TableModel {+ fn default() -> Self {+ Self::new()+ }+}++impl TableModel {+ #[must_use]+ pub fn new() -> Self {+ Self {+ layout: ColumnLayout::default(),+ mask: RowMask::Identity,+ filter: RowMask::Identity,+ total: 0,+ opts: TableOptions::default(),+ sel: RowSelection::default(),+ sel_col: None,+ sel_cell: None,+ right_clicked: None,+ sort: None,+ scroll: (0.0, 0.0),+ size: (0.0, 0.0),+ unit: 20.0,+ scale: 1.0,+ hover: None,+ drag: Drag::None,+ visible: TableVisibleRange::default(),+ groups: None,+ loading: false,+ events: Vec::new(),+ }+ }++ // -- data -----------------------------------------------------------------------------------++ /// Replace the column list (the data changed): widths of columns with the+ /// same key survive, and so does their order and the sort indicator.+ pub fn set_columns(&mut self, cols: Vec<Column>, groups: Option<Vec<Vec<ColumnGroup>>>) {+ self.layout.reset(cols);+ if let Some((c, s)) = self.sort {+ self.layout.mark_sorted(c, s);+ }+ self.groups = groups;+ }++ pub const fn set_loading(&mut self, loading: bool) {+ self.loading = loading;+ }++ /// Whether the loading skeleton is shown.+ #[must_use]+ pub const fn loading(&self) -> bool {+ self.loading+ }++ /// The data has `n` rows now. Returns whether that changed anything: the+ /// filter is dropped, the sort redone and the selection clamped.+ pub fn set_rows<S: CellSource + ?Sized>(&mut self, n: usize, src: &S) -> bool {+ if n == self.total {+ return false;+ }+ self.total = n;+ self.filter = RowMask::Identity;+ self.mask = RowMask::Identity;+ if let Some((c, s)) = self.sort {+ self.resort(src, c, s);+ }+ self.sel.clamp(self.rows());+ true+ }++ /// Rows shown (after filtering).+ #[must_use]+ pub const fn rows(&self) -> usize {+ self.mask.len(self.total)+ }++ /// The data row shown at display row `view_row`.+ #[must_use]+ pub fn row_at(&self, view_row: usize) -> usize {+ self.mask.get(view_row)+ }++ /// The display row showing data row `row` (linear when sorted).+ #[must_use]+ pub fn view_row_of(&self, row: usize) -> Option<usize> {+ self.mask.position_of(row, self.total)+ }++ /// Show only the rows `keep` accepts (an index mask: nothing is copied),+ /// keeping the current sort. Selection is cleared.+ pub fn set_filter<S: CellSource + ?Sized>(&mut self, src: &S, keep: impl Fn(usize) -> bool) {+ self.filter = RowMask::Identity.filtered(self.total, keep);+ self.mask = self.filter.clone();+ if let Some((c, s)) = self.sort {+ self.resort(src, c, s);+ }+ self.clear_selection_quiet();+ self.scroll.1 = 0.0;+ }++ /// Show every row again.+ pub fn clear_filter<S: CellSource + ?Sized>(&mut self, src: &S) {+ self.filter = RowMask::Identity;+ self.mask = RowMask::Identity;+ if let Some((c, s)) = self.sort {+ self.resort(src, c, s);+ }+ self.clear_selection_quiet();+ }++ /// The current sort (source column, sort).+ #[must_use]+ pub const fn sorted_by(&self) -> Option<(usize, ColumnSort)> {+ self.sort+ }++ fn resort<S: CellSource + ?Sized>(&mut self, src: &S, col: usize, sort: ColumnSort) {+ self.mask = if sort == ColumnSort::Default {+ self.filter.clone()+ } else {+ sorted_by_column(src, col, &self.filter, self.total, sort == ColumnSort::Descending)+ };+ }++ /// Sort by source column `col` (what a header click does). The mask is+ /// rebuilt unless `by_mask` is false (the data sorts itself, see the+ /// adapter's `perform_sort`); a [`TableEvent::Sorted`] is queued either way.+ pub fn sort_by<S: CellSource + ?Sized>(&mut self, src: &S, col: usize, sort: ColumnSort, by_mask: bool) {+ self.sort = (sort != ColumnSort::Default).then_some((col, sort));+ if by_mask {+ self.resort(src, col, sort);+ } else {+ self.mask = self.filter.clone();+ }+ self.clear_selection_quiet();+ self.events.push(TableEvent::Sorted(col, sort));+ // the sort indicator lives in the layout's column description+ self.layout.mark_sorted(col, sort);+ }++ // -- columns ----------------------------------------------------------------------------------++ /// The live column layout.+ #[must_use]+ pub const fn layout(&self) -> &ColumnLayout {+ &self.layout+ }++ /// The width of source column `col`.+ #[must_use]+ pub fn col_width(&self, col: usize) -> Option<f32> {+ self.layout.view_of(col).map(|v| self.layout.width(v))+ }++ /// Set the width of source column `col` (a fit). Returns whether it changed.+ pub fn set_col_width(&mut self, col: usize, width: f32) -> bool {+ let Some(v) = self.layout.view_of(col) else { return false };+ let changed = self.layout.set_width(v, width);+ if changed {+ self.widths_changed();+ }+ changed+ }++ pub(crate) fn widths_changed(&mut self) {+ self.events.push(TableEvent::ColumnWidthsChanged(self.layout.widths()));+ self.clamp_scroll();+ }++ /// Header names, in view order.+ #[must_use]+ pub fn headers(&self) -> Vec<String> {+ (0..self.layout.len()).map(|v| self.layout.column(v).name.to_string()).collect()+ }++ // -- scrolling --------------------------------------------------------------------------------++ pub(crate) fn clamp_scroll(&mut self) {+ let g = self.geo();+ self.scroll.1 = clamp_scroll(self.scroll.1, self.rows(), f64::from(g.row_h), f64::from(g.body_h));+ self.scroll.0 = if self.scroll.0.is_nan() {+ 0.0+ } else {+ self.scroll.0.clamp(0.0, f64::from((self.layout.scroll_width() - g.view_w).max(0.0)))+ };+ }++ /// Scroll by pixels (positive: down / right). Returns whether it moved.+ pub fn scroll_by(&mut self, dx: f64, dy: f64) -> bool {+ let before = self.scroll;+ self.scroll.0 += dx;+ self.scroll.1 += dy;+ self.clamp_scroll();+ self.scroll != before+ }++ /// The scroll offset in pixels (x, y).+ #[must_use]+ pub const fn scroll_offset(&self) -> (f64, f64) {+ self.scroll+ }++ /// Scroll so display row `v` is in view (nothing until the table has a size).+ pub fn show_view_row(&mut self, v: usize) {+ let g = self.geo();+ if g.body_h <= 0.0 {+ return;+ }+ self.scroll.1 = scroll_to_show(self.scroll.1, v, f64::from(g.row_h), f64::from(g.body_h));+ self.clamp_scroll();+ }++ /// Scroll so view column `v` (not a pinned one) is in view.+ pub fn show_view_col(&mut self, v: usize) {+ let g = self.geo();+ let l = f64::from(self.layout.left(v));+ let w = f64::from(self.layout.width(v));+ let view = f64::from(g.view_w);+ self.scroll.0 = if l < self.scroll.0 {+ l+ } else if l + w > self.scroll.0 + view {+ l + w - view+ } else {+ self.scroll.0+ };+ self.clamp_scroll();+ }++ /// Scroll so source row `row` is in view. Returns whether the row exists.+ pub fn scroll_to_row(&mut self, row: usize) -> bool {+ self.view_row_of(row).map(|v| self.show_view_row(v)).is_some()+ }++ /// Scroll so source column `col` is in view. Returns whether it is a+ /// scrolling column.+ pub fn scroll_to_col(&mut self, col: usize) -> bool {+ match self.layout.view_of(col).filter(|&v| v >= self.layout.pinned()) {+ Some(v) => {+ self.show_view_col(v);+ true+ }+ None => false,+ }+ }++ /// Rows and columns in view now (display rows, view columns).+ #[must_use]+ pub const fn visible_range(&self) -> &TableVisibleRange {+ &self.visible+ }++ /// Record the table's size for this frame, keep the scroll in range and+ /// report what became visible. Call once per frame before painting.+ pub fn begin_frame(&mut self, width: f32, height: f32, unit: f32, scale: f32) -> FrameReport {+ self.size = (width, height);+ self.unit = unit;+ self.scale = scale;+ self.clamp_scroll();+ let g = self.geo();+ let vis = self.compute_visible(&g);+ let mut report = FrameReport { rows_left: self.rows().saturating_sub(vis.rows.end), ..FrameReport::default() };+ if vis != self.visible {+ if vis.rows != self.visible.rows {+ report.rows_changed = Some(vis.rows.clone());+ }+ if vis.cols != self.visible.cols {+ report.cols_changed = Some(vis.cols.clone());+ }+ self.visible = vis;+ }+ report+ }++ /// The table's size (width, height) as last given to [`begin_frame`](Self::begin_frame).+ #[must_use]+ pub const fn size(&self) -> (f32, f32) {+ self.size+ }++ /// The UI scale (device pixels per logical pixel) the table was last laid out with.+ #[must_use]+ pub const fn scale(&self) -> f32 {+ self.scale+ }++ /// The UI unit the table was last laid out with.+ #[must_use]+ pub const fn unit(&self) -> f32 {+ self.unit+ }++ // -- selection ----------------------------------------------------------------------------------++ #[must_use]+ pub fn selection(&self) -> TableSelection {+ if let Some((r, c)) = self.sel_cell {+ TableSelection::Cell(r, c)+ } else if let Some(c) = self.sel_col {+ TableSelection::Column(c)+ } else if let Some(r) = self.selected_row() {+ TableSelection::Row(r)+ } else {+ TableSelection::None+ }+ }++ /// The active selected row (source index).+ #[must_use]+ pub fn selected_row(&self) -> Option<usize> {+ self.sel.active().filter(|&a| self.sel.contains(a)).map(|v| self.mask.get(v))+ }++ /// Every selected row (source indices, display order).+ pub fn selected_rows(&self) -> impl Iterator<Item = usize> + '_ {+ self.sel.iter().map(|v| self.mask.get(v))+ }++ /// The selected display-row ranges.+ #[must_use]+ pub fn selected_ranges(&self) -> &[Range<usize>] {+ self.sel.ranges()+ }++ #[must_use]+ pub const fn selected_col(&self) -> Option<usize> {+ self.sel_col+ }++ #[must_use]+ pub const fn selected_cell(&self) -> Option<(usize, usize)> {+ self.sel_cell+ }++ #[must_use]+ pub fn right_clicked_row(&self) -> Option<usize> {+ self.right_clicked.map(|(r, _)| r)+ }++ #[must_use]+ pub fn right_clicked_cell(&self) -> Option<(usize, usize)> {+ self.right_clicked.and_then(|(r, c)| c.map(|c| (r, c)))+ }++ pub fn set_right_clicked_row(&mut self, row: Option<usize>) {+ self.right_clicked = row.map(|r| (r, None));+ }++ /// Select only source row `row` and show it. Returns whether it exists.+ pub fn set_selected_row(&mut self, row: usize) -> bool {+ let Some(v) = self.view_row_of(row) else { return false };+ self.sel.select_only(v);+ self.sel_col = None;+ self.sel_cell = None;+ self.show_view_row(v);+ self.events.push(TableEvent::SelectRow(row));+ true+ }++ pub fn set_selected_col(&mut self, col: usize) {+ self.sel.clear();+ self.sel_cell = None;+ self.sel_col = Some(col);+ self.events.push(TableEvent::SelectColumn(col));+ }++ /// Select one cell and show its row. Returns whether the row exists.+ pub fn set_selected_cell(&mut self, row: usize, col: usize) -> bool {+ let Some(v) = self.view_row_of(row) else { return false };+ self.sel.select_only(v);+ self.sel_col = None;+ self.sel_cell = Some((row, col));+ self.show_view_row(v);+ self.events.push(TableEvent::SelectCell(row, col));+ true+ }++ /// Apply a [`TableSelection`]. Returns whether anything was selected or cleared.+ pub fn set_selection(&mut self, selection: TableSelection) -> bool {+ match selection {+ TableSelection::None => {+ self.clear_selection();+ true+ }+ TableSelection::Row(r) => self.set_selected_row(r),+ TableSelection::Column(c) => {+ self.set_selected_col(c);+ true+ }+ TableSelection::Cell(r, c) => self.set_selected_cell(r, c),+ }+ }++ pub fn clear_selection(&mut self) {+ self.clear_selection_quiet();+ self.events.push(TableEvent::ClearSelection);+ }++ pub(crate) fn clear_selection_quiet(&mut self) {+ self.sel.clear();+ self.sel_col = None;+ self.sel_cell = None;+ }++ /// Events raised since the last call.+ pub fn take_events(&mut self) -> Vec<TableEvent> {+ std::mem::take(&mut self.events)+ }++ /// Whether a pointer drag is in progress.+ #[must_use]+ pub fn dragging(&self) -> bool {+ self.drag != Drag::None+ }++ /// The drag in progress.+ #[must_use]+ pub const fn drag(&self) -> Drag {+ self.drag+ }++ /// The hovered display row.+ #[must_use]+ pub const fn hover(&self) -> Option<usize> {+ self.hover+ }++ // -- text -----------------------------------------------------------------------------------------++ /// Display rows `range` as text (headers aside).+ #[must_use]+ pub fn dump_range<S: CellSource + ?Sized>(&self, src: &S, range: Range<usize>) -> Vec<Vec<String>> {+ let mut buf = crate::fmt::CellBuf::new();+ range+ .filter(|&v| v < self.rows())+ .map(|v| {+ let r = self.mask.get(v);+ (0..self.layout.len()).map(|c| src.cell(r, self.layout.src(c)).text(&mut buf).to_owned()).collect()+ })+ .collect()+ }++ /// The whole table as text (headers, rows in display order).+ #[must_use]+ pub fn dump<S: CellSource + ?Sized>(&self, src: &S) -> (Vec<String>, Vec<Vec<String>>) {+ (self.headers(), self.dump_range(src, 0..self.rows()))+ }++ /// The selection as tab-separated text, one line per selected row in+ /// display order, columns in view order (what Ctrl+C copies). A selected+ /// cell copies that cell, a selected column that column. Tabs and line+ /// breaks inside a cell become spaces.+ #[must_use]+ pub fn selection_text<S: CellSource + ?Sized>(&self, src: &S) -> String {+ let mut out = String::new();+ let mut buf = crate::fmt::CellBuf::new();+ let push = |out: &mut String, s: &str| out.extend(s.chars().map(|c| if matches!(c, '\t' | '\n' | '\r') { ' ' } else { c }));+ if let Some((r, c)) = self.sel_cell {+ push(&mut out, src.cell(r, c).text(&mut buf));+ } else if let Some(c) = self.sel_col {+ for v in 0..self.rows() {+ push(&mut out, src.cell(self.mask.get(v), c).text(&mut buf));+ out.push('\n');+ }+ } else {+ for v in self.sel.iter() {+ let r = self.mask.get(v);+ for c in 0..self.layout.len() {+ if c > 0 {+ out.push('\t');+ }+ push(&mut out, src.cell(r, self.layout.src(c)).text(&mut buf));+ }+ out.push('\n');+ }+ }+ out+ }+}diff --git a/bindings/rust/blenderui-table/src/paint.rs b/bindings/rust/blenderui-table/src/paint.rsnew file mode 100644index 0000000..640d9b8--- /dev/null+++ b/bindings/rust/blenderui-table/src/paint.rs@@ -0,0 +1,488 @@+//! Painting a table: a port of Blender's spreadsheet drawing+//! (`spreadsheet_draw.cc`) onto an abstract [`PaintSink`]. Only the visible+//! cells are touched, straight into the sink: no element per cell, no+//! allocation once the scratch strings have grown.+//!+//! * `draw_alternating_row_overlay`: [`draw_alternating_row_pairs`]+//! * header: `draw_top_row_bg` + `draw_column_headers` (sticky: drawn outside+//! the scrolled body, clipped to its own strip)+//! * index column: `draw_left_column_bg` + `draw_left_column_content`+//! * cells: `draw_spreadsheet_cells`, with `get_visible_rows` and the+//! `right_x >= left && left_x <= region_w` column culling+//! ([`visible_rows`], [`visible_cols`])+//! * lines: `draw_separator_lines`+//! * column moving: `draw_column_move_overlay` (insert indicator)+//!+//! Blender's `UI_widgetbase_draw_cache` batches widget quads into instanced+//! draws; here the batching is in what the table emits: a selection of any+//! number of adjacent rows is **one** quad, a column's separator is one quad,+//! and a cell without a background emits none. Text goes through the sink,+//! which owns the glyph/shape cache ([`crate::TextCache`]).++use std::cell::Cell as StdCell;+use std::ops::Range;++use crate::cell::CellSource;+use crate::column::{ColumnSort, TextAlign};+use crate::fmt::CellBuf;+use crate::geom::{Rect, Rgba};+pub use blenderui_paint::{PaintSink, Palette};+use crate::geometry::Geometry;+use crate::model::{Drag, TableModel};+use crate::visible::{visible_cols, visible_rows};++/// Scratch strings reused every frame (cell formatting, truncation).+#[derive(Default)]+pub struct PaintScratch {+ cell: CellBuf,+ ell: String,+}++thread_local! {+ static SCRATCH: StdCell<Option<PaintScratch>> = const { StdCell::new(None) };+}++/// Run `f` with this thread's scratch (taken and put back, so painting can+/// nest no deeper than one table; there is no borrow to fail).+pub fn with_scratch<R>(f: impl FnOnce(&mut PaintScratch) -> R) -> R {+ let mut s = SCRATCH.take().unwrap_or_default();+ let r = f(&mut s);+ SCRATCH.set(Some(s));+ r+}++/// `s` cut with a trailing ellipsis to fit `avail` px (Blender clips cell+/// text with `UI_text_clip_middle`/`ui_text_clip_right_label`). Cells that+/// obviously fit (by an upper bound on their width) are not measured.+fn fit_text<'a>(s: &'a str, avail: f32, size: f32, sink: &mut dyn PaintSink, out: &'a mut String) -> &'a str {+ if s.len() as f32 * size * 0.4 <= avail * 0.8 {+ return s;+ }+ if s.len() as f32 * size * 1.2 < avail || sink.text_width(s, size) <= avail {+ return s;+ }+ // longest prefix whose width plus "..." fits (bisection on char boundaries)+ let ends = |k: usize| s.char_indices().nth(k).map_or(s.len(), |(i, _)| i);+ let (mut lo, mut hi) = (0usize, s.chars().count());+ while lo < hi {+ let mid = (lo + hi).div_ceil(2);+ out.clear();+ out.push_str(&s[..ends(mid)]);+ out.push('\u{2026}');+ if sink.text_width(out, size) <= avail {+ lo = mid;+ } else {+ hi = mid - 1;+ }+ }+ out.clear();+ out.push_str(&s[..ends(lo)]);+ out.push('\u{2026}');+ out+}++/// Blender's `draw_alternating_row_overlay`: one pass over the visible row+/// pairs, tinting the second row of each pair.+pub fn draw_alternating_row_pairs(sink: &mut dyn PaintSink, rows: &Range<usize>, row_rect: impl Fn(usize) -> Rect, color: Rgba) {+ let mut r = rows.start | 1;+ if r < rows.start {+ r += 2;+ }+ while r < rows.end {+ sink.fill(row_rect(r), color);+ r += 2;+ }+}++/// Everything one paint call needs besides the sink.+struct Frame<'a, S: CellSource + ?Sized> {+ t: &'a TableModel,+ src: &'a S,+ g: Geometry,+ pal: &'a Palette,+ size: f32,+ hair: f32,+}++/// Paint `t` (its data from `src`) into `sink`, in the table's own size.+pub fn paint_table<S: CellSource + ?Sized>(t: &TableModel, src: &S, pal: &Palette, empty: &str, scratch: &mut PaintScratch, sink: &mut dyn PaintSink) {+ let g = t.geo();+ let f = Frame { t, src, g, pal, size: t.opts.text_size.unwrap_or_else(|| (g.unit * 0.6).round().max(8.0)), hair: 1.0 / t.scale.max(1.0) };+ let n = t.rows();+ let rows = visible_rows(t.scroll.1, f64::from(g.row_h), f64::from(g.body_h), n);+ sink.fill(Rect::new(0.0, 0.0, g.w, g.h), pal.back);++ // ---- body: stripes, selection, cells ----+ let body = Rect::new(0.0, g.top, g.w, g.body_h);+ sink.clipped(body, &mut |sink| {+ if t.loading {+ f.draw_loading(sink);+ } else if n == 0 {+ let w = sink.text_width(empty, f.size);+ sink.text((g.w - w) / 2.0, g.top + g.body_h * 0.35 + f.size * 0.5, empty, f.size, pal.dim);+ } else {+ f.draw_rows_bg(sink, &rows, 0.0, g.w);+ f.draw_scrolled_cells(sink, &rows, scratch);+ if g.pinned_w > 0.0 {+ // sticky columns: an opaque strip over the scrolled cells+ let strip = Rect::new(g.index_w, g.top, g.pinned_w, g.body_h);+ sink.clipped(strip, &mut |sink| {+ sink.fill(strip, pal.back);+ f.draw_rows_bg(sink, &rows, g.index_w, g.pinned_w);+ for v in 0..t.layout.pinned() {+ f.draw_column_cells(sink, &rows, v, f.t.col_x(&g, v), scratch);+ f.vline(sink, f.t.col_x(&g, v) + t.layout.width(v), g.top, g.body_h);+ }+ });+ if t.opts.fixed_cols_border {+ sink.fill(Rect::new(g.x0 - f.hair, g.top, f.hair, g.body_h), pal.line);+ }+ }+ if t.opts.row_header {+ f.draw_index_column(sink, &rows, scratch);+ }+ }+ });++ // ---- headers (outside the scrolled body: sticky) ----+ f.draw_headers(sink, scratch);+ f.draw_scrollbars(sink);+ if t.opts.bordered {+ sink.stroke(Rect::new(0.0, 0.0, g.w, g.h), pal.line, f.hair.max(1.0));+ }+}++impl<S: CellSource + ?Sized> Frame<'_, S> {+ /// A one-pixel vertical separator ending at `right`.+ fn vline(&self, sink: &mut dyn PaintSink, right: f32, y: f32, h: f32) {+ sink.fill(Rect::new(right - self.hair, y, self.hair, h), self.pal.line);+ }++ fn pad(&self) -> f32 {+ (self.g.unit * 0.3).round()+ }++ fn draw_loading(&self, sink: &mut dyn PaintSink) {+ let g = &self.g;+ let n = (g.body_h / g.row_h).ceil() as usize;+ let cols = visible_cols(self.t.layout.scroll_edges(), 0.0, g.view_w);+ for r in 0..n {+ let y = g.top + r as f32 * g.row_h + g.row_h * 0.3;+ for c in cols.clone() {+ let x = g.x0 + self.t.layout.scroll_edges()[c];+ let w = self.t.layout.width(c + self.t.layout.pinned()) * 0.6;+ sink.round(Rect::new(x + g.unit * 0.3, y, w, g.row_h * 0.4), 3.0, self.pal.text.opacity(0.1));+ }+ }+ }++ /// Blender's `draw_alternating_row_overlay` (pairs of rows: the second row+ /// of each pair is tinted), then selection (one quad per run of selected+ /// rows) and hover, over `x..x+w`.+ fn draw_rows_bg(&self, sink: &mut dyn PaintSink, rows: &Range<usize>, x: f32, w: f32) {+ let (g, t) = (&self.g, self.t);+ if t.opts.stripe {+ draw_alternating_row_pairs(sink, rows, |r| Rect::new(x, t.row_top(g, r), w, g.row_h), self.pal.alt);+ }+ let ranges = t.sel.ranges();+ let first = ranges.partition_point(|r| r.end <= rows.start);+ for run in &ranges[first..] {+ if run.start >= rows.end {+ break;+ }+ let (lo, hi) = (run.start.max(rows.start), run.end.min(rows.end));+ let top = t.row_top(g, lo);+ sink.fill(Rect::new(x, top, w, (hi - lo) as f32 * g.row_h), self.pal.sel);+ }+ if let Some(h) = t.hover.filter(|h| rows.contains(h) && !t.sel.contains(*h)) {+ sink.fill(Rect::new(x, t.row_top(g, h), w, g.row_h), self.pal.hover);+ }+ }++ fn draw_scrolled_cells(&self, sink: &mut dyn PaintSink, rows: &Range<usize>, scratch: &mut PaintScratch) {+ let (g, t) = (&self.g, self.t);+ let sx = t.scroll.0 as f32;+ sink.clipped(Rect::new(g.x0, g.top, g.view_w, g.body_h), &mut |sink| {+ for c in visible_cols(t.layout.scroll_edges(), sx, sx + g.view_w) {+ let v = c + t.layout.pinned();+ let x = t.col_x(g, v);+ self.draw_column_cells(sink, rows, v, x, scratch);+ self.vline(sink, x + t.layout.width(v), g.top, g.body_h);+ }+ });+ }++ /// One column's visible cells (Blender's inner loop of+ /// `draw_spreadsheet_cells`: rows `first_row .. first_row + max_visible`).+ fn draw_column_cells(&self, sink: &mut dyn PaintSink, rows: &Range<usize>, v: usize, x: f32, scratch: &mut PaintScratch) {+ let (g, t) = (&self.g, self.t);+ let col = t.layout.column(v);+ let source = t.layout.src(v);+ let w = t.layout.width(v);+ let pad = self.pad();+ let avail = (w - 2.0 * pad).max(0.0);+ let selected_cell = t.sel_cell.filter(|&(_, c)| c == source);+ let PaintScratch { cell: buf, ell } = scratch;+ for r in rows.clone() {+ let top = t.row_top(g, r);+ let row = t.mask.get(r);+ let cell = self.src.cell(row, source);+ let text = cell.text(buf);+ if !text.is_empty() {+ let shown = fit_text(text, avail, self.size, sink, ell);+ let tx = match col.align {+ TextAlign::Right => x + w - pad - sink.text_width(shown, self.size),+ TextAlign::Center => x + (w - sink.text_width(shown, self.size)) / 2.0,+ TextAlign::Left => x + pad,+ };+ sink.text(tx, top + g.row_h / 2.0, shown, self.size, self.pal.text);+ }+ if selected_cell.is_some_and(|(sr, _)| sr == row) {+ sink.stroke(Rect::new(x, top, w, g.row_h), self.pal.accent, 1.5);+ }+ }+ if t.sel_col == Some(source) {+ sink.fill(Rect::new(x, g.top, w, g.body_h), self.pal.accent.opacity(0.18));+ }+ }++ /// Blender's left index column.+ fn draw_index_column(&self, sink: &mut dyn PaintSink, rows: &Range<usize>, scratch: &mut PaintScratch) {+ let (g, t) = (&self.g, self.t);+ let strip = Rect::new(0.0, g.top, g.index_w, g.body_h);+ sink.clipped(strip, &mut |sink| {+ sink.fill(strip, self.pal.header);+ for r in rows.clone() {+ let top = t.row_top(g, r);+ scratch.cell.clear();+ scratch.cell.push_u64(t.mask.get(r) as u64);+ let text = scratch.cell.as_str();+ let w = sink.text_width(text, self.size);+ sink.text(g.index_w - w - g.unit * 0.3, top + g.row_h / 2.0, text, self.size, self.pal.dim);+ }+ self.vline(sink, g.index_w, g.top, g.body_h);+ });+ }++ fn draw_headers(&self, sink: &mut dyn PaintSink, scratch: &mut PaintScratch) {+ let (g, t, pal) = (&self.g, self.t, self.pal);+ let hair = self.hair;+ sink.fill(Rect::new(0.0, 0.0, g.w, g.top), pal.header);+ // group rows+ if let Some(levels) = &t.groups {+ for (lvl, groups) in levels.iter().enumerate() {+ let y = lvl as f32 * g.header_h;+ let mut at = 0usize;+ for gr in groups {+ let end = (at + gr.span).min(t.layout.len());+ if at >= end {+ break;+ }+ let (l, r) = (t.col_x(g, at), t.col_x(g, end - 1) + t.layout.width(end - 1));+ let (l, r) = (l.max(g.index_w), r.min(g.w));+ if r > l {+ sink.clipped(Rect::new(l, y, r - l, g.header_h), &mut |sink| {+ let w = sink.text_width(&gr.label, self.size);+ sink.text(l + ((r - l) - w) / 2.0, y + g.header_h / 2.0, &gr.label, self.size, pal.text);+ sink.fill(Rect::new(r - hair, y, hair, g.header_h), pal.line);+ });+ }+ at = end;+ }+ sink.fill(Rect::new(0.0, y + g.header_h - hair, g.w, hair), pal.line);+ }+ }+ let hy = g.groups_h;+ let sx = t.scroll.0 as f32;+ sink.clipped(Rect::new(g.x0, hy, g.view_w, g.header_h), &mut |sink| {+ for c in visible_cols(t.layout.scroll_edges(), sx, sx + g.view_w) {+ self.draw_header_cell(sink, c + t.layout.pinned(), scratch);+ }+ });+ if g.pinned_w > 0.0 {+ let strip = Rect::new(g.index_w, hy, g.pinned_w, g.header_h);+ sink.clipped(strip, &mut |sink| {+ sink.fill(strip, pal.header);+ for v in 0..t.layout.pinned() {+ self.draw_header_cell(sink, v, scratch);+ }+ });+ }+ sink.fill(Rect::new(0.0, g.top - hair, g.w, hair), pal.line);+ // Blender's column move: dim the grabbed column, mark where it lands+ if let Drag::Header { v, moved: true, to, .. } = t.drag {+ let x = t.col_x(g, v);+ sink.fill(Rect::new(x, hy, t.layout.width(v), g.header_h), pal.back.shade(-20.0).opacity(0.5));+ let tx = t.col_x(g, to) + if to > v { t.layout.width(to) } else { 0.0 };+ sink.fill(Rect::new(tx - 1.0, hy, 2.0, g.header_h + g.body_h), pal.text.shade(20.0));+ }+ }++ fn draw_header_cell(&self, sink: &mut dyn PaintSink, v: usize, scratch: &mut PaintScratch) {+ let (g, t, pal) = (&self.g, self.t, self.pal);+ let col = t.layout.column(v);+ let x = t.col_x(g, v);+ let w = t.layout.width(v);+ let hy = g.groups_h;+ let pad = self.pad();+ let arrow = if col.sort.is_some() && t.opts.sortable { g.unit * 0.7 } else { 0.0 };+ let text = fit_text(&col.name, (w - 2.0 * pad - arrow).max(0.0), self.size, sink, &mut scratch.ell);+ let tx = match col.align {+ TextAlign::Right => x + w - pad - arrow - sink.text_width(text, self.size),+ TextAlign::Center => x + (w - arrow - sink.text_width(text, self.size)) / 2.0,+ TextAlign::Left => x + pad,+ };+ sink.text(tx, hy + g.header_h / 2.0, text, self.size, pal.text);+ if let (Some(s @ (ColumnSort::Ascending | ColumnSort::Descending)), true) = (col.sort, t.opts.sortable) {+ // a chevron: two lines+ let (cx, cy, k) = (x + w - pad - g.unit * 0.25, hy + g.header_h / 2.0, g.unit * 0.15);+ let d = if s == ColumnSort::Ascending { -k } else { k };+ sink.line((cx - k, cy - d / 2.0), (cx, cy + d / 2.0), pal.text, 1.5);+ sink.line((cx, cy + d / 2.0), (cx + k, cy - d / 2.0), pal.text, 1.5);+ }+ if t.sel_col == Some(t.layout.src(v)) {+ sink.fill(Rect::new(x, hy, w, g.header_h), pal.accent.opacity(0.25));+ }+ self.vline(sink, x + w, hy, g.header_h);+ }++ fn draw_scrollbars(&self, sink: &mut dyn PaintSink) {+ let (g, t) = (&self.g, self.t);+ let thumb = self.pal.text.opacity(0.35);+ if let Some((ty, th)) = t.vthumb(g) {+ sink.round(Rect::new(g.w - g.bar + 1.0, ty, g.bar - 2.0, th), (g.bar - 2.0) / 2.0, thumb);+ }+ if let Some((tx, tw)) = t.hthumb(g) {+ sink.round(Rect::new(tx, g.h - g.bar + 1.0, tw, g.bar - 2.0), (g.bar - 2.0) / 2.0, thumb);+ }+ }+}++#[cfg(test)]+mod tests {+ use super::*;+ use crate::cell::Cell;+ use crate::column::Column;++ /// Records what the table paints.+ #[derive(Default)]+ struct Rec {+ fills: Vec<Rect>,+ texts: Vec<String>,+ depth: i32,+ }++ impl PaintSink for Rec {+ fn fill(&mut self, r: Rect, _: Rgba) {+ self.fills.push(r);+ }+ fn stroke(&mut self, _: Rect, _: Rgba, _: f32) {}+ fn round(&mut self, _: Rect, _: f32, _: Rgba) {}+ fn line(&mut self, _: (f32, f32), _: (f32, f32), _: Rgba, _: f32) {}+ fn text(&mut self, _: f32, _: f32, text: &str, _: f32, _: Rgba) {+ self.texts.push(text.to_owned());+ }+ fn text_width(&mut self, text: &str, size: f32) -> f32 {+ text.len() as f32 * size * 0.5+ }+ fn clipped(&mut self, _: Rect, f: &mut dyn FnMut(&mut dyn PaintSink)) {+ self.depth += 1;+ f(self);+ self.depth -= 1;+ }+ }++ struct Data;+ impl CellSource for Data {+ fn cell(&self, r: usize, c: usize) -> Cell<'_> {+ Cell::U64((r * 10 + c) as u64)+ }+ }++ fn model(rows: usize) -> (TableModel, Data) {+ let d = Data;+ let mut t = TableModel::new();+ t.set_columns((0..6).map(|i| Column::new(format!("c{i}"), format!("C{i}")).width(80.0_f32)).collect(), None);+ t.set_rows(rows, &d);+ t.begin_frame(300.0, 200.0, 20.0, 1.0);+ (t, d)+ }++ fn pal() -> Palette {+ let c = |v: f32| Rgba::new(v, v, v, 1.0);+ Palette::new(c(0.2), c(0.9), c(0.3), c(0.5), c(0.7))+ }++ fn paint(t: &TableModel, d: &Data) -> Rec {+ let mut rec = Rec::default();+ with_scratch(|s| paint_table(t, d, &pal(), "No data", s, &mut rec));+ assert_eq!(rec.depth, 0, "clips are balanced");+ rec+ }++ #[test]+ fn paints_only_visible_cells() {+ let (t, d) = model(1_000_000);+ let rec = paint(&t, &d);+ // header names + visible cells: (200 - 22) / 20 rows, 300 px of 80 px columns+ let cells = rec.texts.iter().filter(|s| s.parse::<u64>().is_ok()).count();+ assert!(cells <= 10 * 5, "{cells}");+ assert!(cells >= 8 * 3);+ }++ #[test]+ fn a_selection_of_many_rows_is_one_quad() {+ let (mut t, d) = model(1000);+ let base = paint(&t, &d).fills.len();+ t.sel.select_all(1000);+ let all = paint(&t, &d).fills.len();+ assert_eq!(all, base + 1, "select-all costs a single fill");+ t.sel.clear();+ t.sel.select_only(3);+ t.sel.add(5..8);+ let two = paint(&t, &d).fills.len();+ assert_eq!(two, base + 2);+ }++ #[test]+ fn right_alignment_measures_through_the_sink() {+ let (mut t, d) = model(10);+ t.set_columns(vec![Column::new("a", "A").width(100.0_f32).text_right()], None);+ t.begin_frame(300.0, 200.0, 20.0, 1.0);+ let rec = paint(&t, &d);+ assert!(rec.texts.iter().any(|s| s == "0"));+ }++ #[test]+ fn steady_state_paint_does_not_allocate_beyond_the_sink() {+ use crate::alloc_probe::count_allocs;+ let (mut t, d) = model(1_000_000);+ t.scroll_by(0.0, 5_000_000.0);+ t.begin_frame(300.0, 200.0, 20.0, 1.0);+ t.opts.stripe = true;+ t.opts.row_header = true;+ // a sink that records nothing: only the table's own allocations count+ struct Null;+ impl PaintSink for Null {+ fn fill(&mut self, _: Rect, _: Rgba) {}+ fn stroke(&mut self, _: Rect, _: Rgba, _: f32) {}+ fn round(&mut self, _: Rect, _: f32, _: Rgba) {}+ fn line(&mut self, _: (f32, f32), _: (f32, f32), _: Rgba, _: f32) {}+ fn text(&mut self, _: f32, _: f32, _: &str, _: f32, _: Rgba) {}+ fn text_width(&mut self, text: &str, size: f32) -> f32 {+ text.len() as f32 * size * 0.5+ }+ fn clipped(&mut self, _: Rect, f: &mut dyn FnMut(&mut dyn PaintSink)) {+ f(self);+ }+ }+ let p = pal();+ with_scratch(|s| {+ for _ in 0..3 {+ paint_table(&t, &d, &p, "", s, &mut Null);+ }+ let n = count_allocs(|| paint_table(&t, &d, &p, "", s, &mut Null));+ assert_eq!(n, 0, "a steady-state frame allocated");+ });+ }+}diff --git a/bindings/rust/blenderui-table/src/selection.rs b/bindings/rust/blenderui-table/src/selection.rsnew file mode 100644index 0000000..918d4f1--- /dev/null+++ b/bindings/rust/blenderui-table/src/selection.rs@@ -0,0 +1,224 @@+//! Row selection as sorted, disjoint ranges of display rows: selecting all+//! a million rows is one range, a click is one range of one.++use std::ops::Range;++use crate::input::Mods;++/// Selected display rows.+#[derive(Debug, Clone, Default, PartialEq, Eq)]+pub struct RowSelection {+ ranges: Vec<Range<usize>>,+ /// Where a shift-extension starts from.+ anchor: Option<usize>,+ /// The row keyboard navigation moves (the "active" row).+ active: Option<usize>,+}++impl RowSelection {+ #[must_use]+ pub const fn is_empty(&self) -> bool {+ self.ranges.is_empty()+ }+ pub fn clear(&mut self) {+ self.ranges.clear();+ self.anchor = None;+ self.active = None;+ }+ /// Number of selected rows.+ pub fn count(&self) -> usize {+ self.ranges.iter().map(ExactSizeIterator::len).sum()+ }+ /// The selected ranges, ascending.+ #[must_use]+ pub fn ranges(&self) -> &[Range<usize>] {+ &self.ranges+ }+ #[must_use]+ pub const fn anchor(&self) -> Option<usize> {+ self.anchor+ }+ /// The row keyboard navigation moves.+ #[must_use]+ pub const fn active(&self) -> Option<usize> {+ self.active+ }+ /// Selected rows, ascending.+ pub fn iter(&self) -> impl Iterator<Item = usize> + '_ {+ self.ranges.iter().flat_map(Clone::clone)+ }++ #[must_use]+ pub fn contains(&self, row: usize) -> bool {+ let i = self.ranges.partition_point(|r| r.end <= row);+ self.ranges.get(i).is_some_and(|r| r.start <= row)+ }++ /// Only `row`.+ pub fn select_only(&mut self, row: usize) {+ self.ranges.clear();+ self.ranges.push(row..row + 1);+ self.anchor = Some(row);+ self.active = Some(row);+ }++ /// Add `rows`, merging neighbours.+ pub fn add(&mut self, rows: Range<usize>) {+ if rows.is_empty() {+ return;+ }+ let lo = self.ranges.partition_point(|r| r.end < rows.start);+ let hi = self.ranges.partition_point(|r| r.start <= rows.end);+ let merged = self.ranges[lo..hi].iter().fold(rows, |acc, r| acc.start.min(r.start)..acc.end.max(r.end));+ self.ranges.splice(lo..hi, [merged]);+ }++ /// Remove `rows`.+ pub fn remove(&mut self, rows: Range<usize>) {+ if rows.is_empty() {+ return;+ }+ let lo = self.ranges.partition_point(|r| r.end <= rows.start);+ let hi = self.ranges.partition_point(|r| r.start < rows.end);+ let mut keep = Vec::with_capacity(2);+ if let Some(first) = self.ranges.get(lo).filter(|r| r.start < rows.start) {+ keep.push(first.start..rows.start);+ }+ if hi > lo+ && let Some(last) = self.ranges.get(hi - 1).filter(|r| r.end > rows.end) {+ keep.push(rows.end..last.end);+ }+ self.ranges.splice(lo..hi, keep);+ }++ pub fn toggle(&mut self, row: usize) {+ if self.contains(row) {+ self.remove(row..row + 1);+ } else {+ self.add(row..row + 1);+ }+ self.anchor = Some(row);+ self.active = Some(row);+ }++ pub fn select_all(&mut self, n: usize) {+ self.ranges.clear();+ if n > 0 {+ self.ranges.push(0..n);+ self.anchor = Some(0);+ self.active = Some(n - 1);+ }+ }++ /// Drop everything at or past `n` rows (the data shrank).+ pub fn clamp(&mut self, n: usize) {+ self.remove(n..usize::MAX);+ self.anchor = self.anchor.filter(|&a| a < n);+ self.active = self.active.filter(|&a| a < n);+ }++ /// A click on `row` with `mods` (single click semantics of Blender's+ /// list: plain replaces, ctrl toggles, shift extends from the anchor,+ /// ctrl+shift adds the range).+ pub fn click(&mut self, row: usize, mods: Mods) {+ match (mods.shift, mods.control) {+ (false, false) => self.select_only(row),+ (false, true) => self.toggle(row),+ (true, ctrl) => {+ let a = self.anchor.unwrap_or(row);+ if !ctrl {+ self.ranges.clear();+ }+ self.add(a.min(row)..a.max(row) + 1);+ self.anchor = Some(a);+ self.active = Some(row);+ }+ }+ }++ /// Move the active row to `to` (keyboard): shift extends from the+ /// anchor, otherwise `to` becomes the only selected row.+ pub fn move_to(&mut self, to: usize, extend: bool) {+ if extend {+ self.click(to, Mods { shift: true, ..Mods::default() });+ } else {+ self.select_only(to);+ }+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ const NONE: Mods = Mods { shift: false, control: false, alt: false };+ const SHIFT: Mods = Mods { shift: true, control: false, alt: false };+ const CTRL: Mods = Mods { shift: false, control: true, alt: false };++ /// The naive reference: a bool per row.+ fn naive(sel: &RowSelection, n: usize) -> Vec<bool> {+ (0..n).map(|r| sel.contains(r)).collect()+ }++ #[test]+ fn click_semantics() {+ let mut s = RowSelection::default();+ s.click(5, NONE);+ s.click(8, SHIFT);+ assert_eq!(s.iter().collect::<Vec<_>>(), vec![5, 6, 7, 8]);+ s.click(2, SHIFT); // re-extends from the anchor 5+ assert_eq!(s.iter().collect::<Vec<_>>(), vec![2, 3, 4, 5]);+ s.click(10, CTRL);+ assert_eq!(s.count(), 5);+ s.click(3, CTRL); // toggle off splits the range+ assert_eq!(s.ranges(), &[2..3, 4..6, 10..11]);+ s.click(7, NONE);+ assert_eq!(s.ranges().to_vec(), vec![7..8]);+ s.select_all(1_000_000);+ assert_eq!(s.count(), 1_000_000);+ assert!(s.contains(999_999) && !s.contains(1_000_000));+ }++ #[test]+ fn random_ops_match_reference() {+ let mut seed = 12345u64;+ let mut next = move || {+ seed ^= seed << 13;+ seed ^= seed >> 7;+ seed ^= seed << 17;+ seed+ };+ let n = 60;+ let mut s = RowSelection::default();+ let mut reference = vec![false; n];+ for _ in 0..4000 {+ let a = (next() % n as u64) as usize;+ let b = a + (next() % 8) as usize;+ let b = b.min(n);+ if next() % 2 == 0 {+ s.add(a..b);+ reference[a..b].iter_mut().for_each(|x| *x = true);+ } else {+ s.remove(a..b);+ reference[a..b].iter_mut().for_each(|x| *x = false);+ }+ assert_eq!(naive(&s, n), reference);+ // sorted, disjoint, non-adjacent+ assert!(s.ranges().windows(2).all(|w| w[0].end < w[1].start));+ }+ }++ #[test]+ fn clamp_and_keyboard() {+ let mut s = RowSelection::default();+ s.select_all(100);+ s.clamp(10);+ assert_eq!(s.count(), 10);+ s.move_to(3, false);+ assert_eq!(s.iter().collect::<Vec<_>>(), vec![3]);+ s.move_to(6, true);+ assert_eq!(s.iter().collect::<Vec<_>>(), vec![3, 4, 5, 6]);+ s.move_to(1, true);+ assert_eq!(s.iter().collect::<Vec<_>>(), vec![1, 2, 3]);+ }+}diff --git a/bindings/rust/blenderui-table/src/sort.rs b/bindings/rust/blenderui-table/src/sort.rsnew file mode 100644index 0000000..5b3527d--- /dev/null+++ b/bindings/rust/blenderui-table/src/sort.rs@@ -0,0 +1,399 @@+//! Sorting a table by a column into a [`RowMask`]: never reorders data.+//!+//! * A column whose cells are all numbers of one variant, or all text,+//! sorts through **typed keys**: one pass extracts an order-preserving+//! `u64` per row (see [`Cell::number_key`], [`Cell::text_prefix`]), then+//! `(key, position)` pairs sort with no cell access and no dynamic call per+//! comparison. Text columns resolve equal 8-byte prefixes with a stable+//! full-text sort of just those runs.+//! * Anything else (mixed variants, [`SortKind::Custom`]) sorts with a+//! comparator on the row index list: the generic path the typed one must+//! agree with (it is the reference in the tests).+//! * Both are stable and run on every core above [`PARALLEL_MIN`] rows: chunks+//! sort on scoped threads, then merge pairwise between two buffers.++use std::cmp::Ordering;+use std::sync::atomic::{AtomicBool, Ordering as AtomicOrdering};++use crate::cell::{Cell, CellKind, CellSource, SortKind};+use crate::mask::RowMask;++/// Below this many rows one thread beats spawning.+pub const PARALLEL_MIN: usize = 1 << 18;++fn threads() -> usize {+ std::thread::available_parallelism().map_or(1, usize::from).min(16)+}++/// Stable parallel merge sort of `v` by `cmp`.+pub fn sort_stable<T: Copy + Send + Sync>(v: &mut Vec<T>, cmp: &(impl Fn(&T, &T) -> Ordering + Sync)) {+ sort_impl(v, cmp, true);+}++/// Parallel sort by a *total* order (no two elements compare equal unless+/// identical), so the faster unstable sort gives the stable result.+pub fn sort_total<T: Copy + Send + Sync>(v: &mut Vec<T>, cmp: &(impl Fn(&T, &T) -> Ordering + Sync)) {+ sort_impl(v, cmp, false);+}++fn sort_impl<T: Copy + Send + Sync>(v: &mut Vec<T>, cmp: &(impl Fn(&T, &T) -> Ordering + Sync), stable: bool) {+ let n = v.len();+ let threads = threads();+ let chunk_sort = move |part: &mut [T]| {+ if stable {+ part.sort_by(cmp);+ } else {+ part.sort_unstable_by(cmp);+ }+ };+ if n < PARALLEL_MIN || threads < 2 {+ chunk_sort(v);+ return;+ }+ let chunk = n.div_ceil(threads);+ std::thread::scope(|s| {+ for part in v.chunks_mut(chunk) {+ s.spawn(move || chunk_sort(part));+ }+ });+ let mut src = std::mem::take(v);+ let mut dst = src.clone();+ let mut width = chunk;+ while width < n {+ std::thread::scope(|s| {+ let mut rest = &mut dst[..];+ let mut at = 0;+ while at < n {+ let end = (at + 2 * width).min(n);+ let (out, tail) = rest.split_at_mut(end - at);+ rest = tail;+ let (a, b) = src[at..end].split_at((at + width).min(end) - at);+ s.spawn(move || merge(a, b, out, cmp));+ at = end;+ }+ });+ std::mem::swap(&mut src, &mut dst);+ width *= 2;+ }+ *v = src;+}++fn merge<T: Copy>(a: &[T], b: &[T], out: &mut [T], cmp: &impl Fn(&T, &T) -> Ordering) {+ let (mut i, mut j) = (0, 0);+ for o in out.iter_mut() {+ // stable: take from `a` unless `b` is strictly smaller+ if j >= b.len() || (i < a.len() && cmp(&b[j], &a[i]) != Ordering::Less) {+ *o = a[i];+ i += 1;+ } else {+ *o = b[j];+ j += 1;+ }+ }+}++/// A `(key, position)` pair: positions index the mask being sorted.+type Pair = (u64, u32);++/// What typed extraction found.+struct Extracted {+ pairs: Vec<Pair>,+ /// Text keys that are the whole text (every string fits the prefix).+ exact: bool,+ text: bool,+}++/// The typed `(key, position)` pairs of column `col` over `base`, or `None`+/// when the cells are not all of one typed kind. `descending` inverts the+/// keys so one ascending sort serves both directions.+fn extract<S: CellSource + ?Sized>(src: &S, col: usize, base: &RowMask, n: usize, descending: bool) -> Option<Extracted> {+ let first = src.cell(base.get(0), col);+ let kind = first.kind();+ if kind == CellKind::Empty {+ return None;+ }+ let disc = std::mem::discriminant(&first);+ let (mismatch, inexact) = (AtomicBool::new(false), AtomicBool::new(false));+ let mut pairs: Vec<Pair> = vec![(0, 0); n];+ let fill = |start: usize, part: &mut [Pair]| {+ for (k, slot) in part.iter_mut().enumerate() {+ let pos = start + k;+ let cell = src.cell(base.get(pos), col);+ let key = if std::mem::discriminant(&cell) == disc {+ match cell {+ Cell::Str(s) => {+ let b = s.as_bytes();+ if b.len() > 8 || b.last() == Some(&0) {+ inexact.store(true, AtomicOrdering::Relaxed);+ }+ cell.text_prefix()+ }+ _ => cell.number_key(),+ }+ } else {+ None+ };+ let Some(key) = key else {+ mismatch.store(true, AtomicOrdering::Relaxed);+ return;+ };+ *slot = (if descending { !key } else { key }, pos as u32);+ }+ };+ let threads = threads();+ if n < PARALLEL_MIN || threads < 2 {+ fill(0, &mut pairs);+ } else {+ let chunk = n.div_ceil(threads);+ std::thread::scope(|s| {+ for (i, part) in pairs.chunks_mut(chunk).enumerate() {+ let fill = &fill;+ s.spawn(move || fill(i * chunk, part));+ }+ });+ }+ (!mismatch.load(AtomicOrdering::Relaxed)).then(|| Extracted {+ pairs,+ exact: !inexact.load(AtomicOrdering::Relaxed),+ text: kind == CellKind::Text,+ })+}++/// `base` sorted by column `col` (`descending` reverses; ties keep the order+/// of `base`).+#[must_use]+pub fn sorted_by_column<S: CellSource + ?Sized>(src: &S, col: usize, base: &RowMask, tot: usize, descending: bool) -> RowMask {+ let n = base.len(tot);+ if n < 2 {+ return RowMask::Indices(base.to_vec(tot));+ }+ // typed keys; falls back when the cells turn out to be mixed+ if src.sort_kind(col) == SortKind::Cells+ && let Some(e) = extract(src, col, base, n, descending) {+ return finish_typed(src, col, base, e, descending);+ }+ sorted_by_comparator(src, col, base, tot, descending)+}++/// The generic path: a comparator on the row index list. Reference for the+/// typed path; also the path for custom comparators and mixed columns.+#[must_use]+pub fn sorted_by_comparator<S: CellSource + ?Sized>(src: &S, col: usize, base: &RowMask, tot: usize, descending: bool) -> RowMask {+ let mut v = base.to_vec(tot);+ let custom = src.sort_kind(col) == SortKind::Custom;+ sort_stable(&mut v, &|&a: &u32, &b: &u32| {+ let o = if custom {+ src.compare(col, a as usize, b as usize)+ } else {+ src.cell(a as usize, col).sort_cmp(&src.cell(b as usize, col))+ };+ if descending { o.reverse() } else { o }+ });+ RowMask::Indices(v)+}++/// Equal 8-byte prefixes: stable full-text order within each run of `pairs`+/// (runs are in position order).+fn fix_prefix_runs<S: CellSource + ?Sized>(src: &S, col: usize, base: &RowMask, descending: bool, pairs: &mut [Pair]) {+ let mut i = 0;+ while i < pairs.len() {+ let mut j = i + 1;+ while j < pairs.len() && pairs[j].0 == pairs[i].0 {+ j += 1;+ }+ if j - i > 1 {+ pairs[i..j].sort_by(|a, b| {+ let (x, y) = (src.cell(base.get(a.1 as usize), col), src.cell(base.get(b.1 as usize), col));+ let o = x.sort_cmp(&y);+ if descending { o.reverse() } else { o }+ });+ }+ i = j;+ }+}++fn finish_typed<S: CellSource + ?Sized>(src: &S, col: usize, base: &RowMask, e: Extracted, descending: bool) -> RowMask {+ let Extracted { mut pairs, exact, text } = e;+ sort_total(&mut pairs, &|a: &Pair, b: &Pair| a.cmp(b));+ if text && !exact {+ let (n, threads) = (pairs.len(), threads());+ if n < PARALLEL_MIN || threads < 2 {+ fix_prefix_runs(src, col, base, descending, &mut pairs);+ } else {+ // runs are independent: cut the pairs at run boundaries, one piece per thread+ let target = n.div_ceil(threads);+ std::thread::scope(|s| {+ let mut rest: &mut [Pair] = &mut pairs;+ while !rest.is_empty() {+ let mut cut = target.min(rest.len());+ while cut < rest.len() && rest[cut].0 == rest[cut - 1].0 {+ cut += 1;+ }+ let (head, tail) = rest.split_at_mut(cut);+ rest = tail;+ s.spawn(move || fix_prefix_runs(src, col, base, descending, head));+ }+ });+ }+ }+ RowMask::Indices(pairs.iter().map(|p| base.get(p.1 as usize) as u32).collect())+}++#[cfg(test)]+mod tests {+ use super::*;+ use crate::test_util::Rng;++ /// A table of generated columns: ints with many ties, floats with NaN and+ /// infinities, short and long text, mixed numbers, and a custom order.+ struct Grid {+ n: usize,+ seed: u64,+ }++ impl Grid {+ fn h(&self, r: usize, c: usize) -> u64 {+ let mut x = (r as u64 + 1).wrapping_mul(0x9E37_79B9_7F4A_7C15) ^ (c as u64 + self.seed).wrapping_mul(0xD6E8_FEB8_6659_FD93);+ x ^= x >> 29;+ x = x.wrapping_mul(0xBF58_476D_1CE4_E5B9);+ x ^ (x >> 32)+ }+ }++ const WORDS: [&str; 6] = ["alpha", "beta", "gamma", "delta-long-word-over-8", "delta-long-word-over-9", ""];++ impl CellSource for Grid {+ fn cell(&self, r: usize, c: usize) -> Cell<'_> {+ let h = self.h(r, c);+ match c {+ 0 => Cell::I64((h % 50) as i64 - 25),+ 1 => Cell::U64(h % 1000),+ 2 => match h % 11 {+ 0 => Cell::F64(f64::NAN, 2),+ 1 => Cell::F64(f64::INFINITY, 2),+ 2 => Cell::F64(f64::NEG_INFINITY, 2),+ 3 => Cell::F64(-0.0, 2),+ _ => Cell::F64((h % 20_000) as f64 / 100.0 - 100.0, 2),+ },+ 3 => Cell::Str(WORDS[(h % 6) as usize]),+ 4 => if h.is_multiple_of(7) { Cell::F64(0.5, 1) } else { Cell::I64((h % 9) as i64) }, // mixed variants+ 5 => Cell::I64((h % 100) as i64), // custom: by |v - 50|+ _ => Cell::Empty,+ }+ }+ fn sort_kind(&self, col: usize) -> SortKind {+ if col == 5 { SortKind::Custom } else { SortKind::Cells }+ }+ fn compare(&self, col: usize, a: usize, b: usize) -> Ordering {+ let k = |r: usize| (self.h(r, col) % 100).abs_diff(50);+ k(a).cmp(&k(b))+ }+ }++ #[test]+ fn typed_path_equals_generic_path() {+ for (n, seed) in [(2usize, 1u64), (3, 2), (1000, 3), (40_000, 4), (100_003, 5)] {+ let g = Grid { n, seed };+ for col in 0..7 {+ for desc in [false, true] {+ let typed = sorted_by_column(&g, col, &RowMask::Identity, g.n, desc);+ let generic = sorted_by_comparator(&g, col, &RowMask::Identity, g.n, desc);+ assert!(typed == generic, "n {n} col {col} desc {desc}");+ }+ }+ }+ }++ #[test]+ fn parallel_typed_paths_equal_generic_path() {+ // above PARALLEL_MIN: threaded key extraction, threaded sort, threaded prefix fix-up+ let g = Grid { n: PARALLEL_MIN + 12_345, seed: 11 };+ for col in [0usize, 2, 3] {+ for desc in [false, true] {+ let typed = sorted_by_column(&g, col, &RowMask::Identity, g.n, desc);+ let generic = sorted_by_comparator(&g, col, &RowMask::Identity, g.n, desc);+ assert!(typed == generic, "col {col} desc {desc}");+ }+ }+ }++ #[test]+ fn sorting_a_filtered_mask_keeps_its_order_on_ties() {+ let g = Grid { n: 60_000, seed: 8 };+ let mut rng = Rng::new(3);+ let mut rows: Vec<u32> = (0..g.n as u32).filter(|_| !rng.next().is_multiple_of(3)).collect();+ // an arbitrary (not ascending) base order: ties must follow it+ for i in (1..rows.len()).rev() {+ rows.swap(i, (rng.next() % (i as u64 + 1)) as usize);+ }+ let base = RowMask::Indices(rows);+ for col in [0usize, 1, 2, 3] {+ for desc in [false, true] {+ let typed = sorted_by_column(&g, col, &base, g.n, desc);+ let generic = sorted_by_comparator(&g, col, &base, g.n, desc);+ assert!(typed == generic, "col {col} desc {desc}");+ }+ }+ }++ #[test]+ fn sorted_output_is_ordered_and_stable() {+ let g = Grid { n: 50_000, seed: 9 };+ let m = sorted_by_column(&g, 1, &RowMask::Identity, g.n, false);+ let v = m.indices().unwrap();+ for w in v.windows(2) {+ let (a, b) = (g.cell(w[0] as usize, 1), g.cell(w[1] as usize, 1));+ match a.sort_cmp(&b) {+ Ordering::Greater => panic!("out of order"),+ Ordering::Equal => assert!(w[0] < w[1], "unstable"),+ Ordering::Less => {}+ }+ }+ let mut seen = v.to_vec();+ seen.sort_unstable();+ assert!(seen.iter().enumerate().all(|(i, &r)| i as u32 == r), "a permutation");+ }++ #[test]+ fn degenerate_sizes() {+ for n in [0usize, 1] {+ let g = Grid { n, seed: 1 };+ assert_eq!(sorted_by_column(&g, 0, &RowMask::Identity, n, false).len(n), n);+ }+ // all-empty column keeps the order+ let g = Grid { n: 10, seed: 1 };+ let m = sorted_by_column(&g, 6, &RowMask::Identity, 10, true);+ assert_eq!(m.indices().unwrap(), (0..10u32).collect::<Vec<_>>().as_slice());+ }++ #[test]+ fn nan_and_negative_zero_are_totally_ordered() {+ let g = Grid { n: 5000, seed: 2 };+ let m = sorted_by_column(&g, 2, &RowMask::Identity, g.n, false);+ let first = g.cell(m.get(0), 2);+ let last = g.cell(m.get(g.n - 1), 2);+ // -inf first (or a -NaN would be, none generated); NaN (positive) last+ assert!(matches!(first, Cell::F64(v, _) if v == f64::NEG_INFINITY));+ assert!(matches!(last, Cell::F64(v, _) if v.is_nan()));+ }++ #[test]+ fn parallel_merge_equals_serial_for_every_width() {+ let mut rng = Rng::new(42);+ for n in [PARALLEL_MIN - 1, PARALLEL_MIN, PARALLEL_MIN + 1, PARALLEL_MIN * 3 + 5] {+ let keys: Vec<u8> = (0..n).map(|_| (rng.next() % 5) as u8).collect();+ let mut v: Vec<u32> = (0..n as u32).collect();+ sort_stable(&mut v, &|&a: &u32, &b: &u32| keys[a as usize].cmp(&keys[b as usize]));+ let mut naive: Vec<u32> = (0..n as u32).collect();+ naive.sort_by_key(|&r| keys[r as usize]);+ assert_eq!(v, naive, "n {n}");+ }+ }++ #[test]+ fn huge_row_index_does_not_overflow_the_key() {+ // positions are u32: a mask is limited to u32::MAX rows by construction+ let p: Pair = (u64::MAX, u32::MAX);+ assert!(p > (u64::MAX, 0));+ }+}diff --git a/bindings/rust/blenderui-table/src/state.rs b/bindings/rust/blenderui-table/src/state.rsnew file mode 100644index 0000000..e7a59b9--- /dev/null+++ b/bindings/rust/blenderui-table/src/state.rs@@ -0,0 +1,316 @@+//! [`TableCore`]: a [`TableModel`] together with its data and the glue that+//! every framework adapter needs and would otherwise copy: calling the+//! delegate's hooks, answering the events the model queues, keeping the+//! model in step with the data, and the selection / scroll API that also has+//! to tell the framework to redraw.+//!+//! The framework enters through one trait, [`Host`], implemented once per+//! adapter on a marker type: its associated types name the framework's+//! window and context, and its functions forward to the framework's+//! delegate trait and to its notify / refresh calls. Everything else is+//! here, once.+//!+//! An adapter's `TableState` is a struct holding a `TableCore<ItsHost>` (and+//! what only it needs, like a focus handle) that implements `Deref` to it;+//! the core's methods then read as the state's own, and `TableCore` derefs+//! to the [`TableModel`] in turn.++use std::ops::{Deref, DerefMut, Range};++use crate::cell::CellSource;+use crate::column::{Column, ColumnGroup, ColumnSort};+use crate::event::{TableEvent, TableSelection};+use crate::geom::Point;+use crate::input::{Button, Key, Mods};+use crate::model::TableModel;++/// What a framework adapter provides: its types and how to reach its+/// delegate's hooks and redraw calls. Reads take the context immutably,+/// hooks take the window and context mutably.+pub trait Host: Sized {+ type Delegate: CellSource;+ /// The framework's window.+ type Window;+ /// The context of the table's entity (it can notify and read the app).+ type Cx<'a>;++ fn columns(delegate: &Self::Delegate, cx: &Self::Cx<'_>) -> Vec<Column>;+ fn group_headers(delegate: &Self::Delegate, cx: &Self::Cx<'_>) -> Option<Vec<Vec<ColumnGroup>>>;+ fn rows_count(delegate: &Self::Delegate, cx: &Self::Cx<'_>) -> usize;+ fn loading(delegate: &Self::Delegate, cx: &Self::Cx<'_>) -> bool;+ /// Whether a header click sorts the row mask (false: the delegate sorts its data).+ fn sort_by_mask(delegate: &Self::Delegate) -> bool;+ fn perform_sort(delegate: &mut Self::Delegate, col: usize, sort: ColumnSort, window: &mut Self::Window, cx: &mut Self::Cx<'_>);+ fn move_column(delegate: &mut Self::Delegate, col: usize, to: usize, window: &mut Self::Window, cx: &mut Self::Cx<'_>);+ /// The width column `col` needs to show its content whole.+ fn fit_column(delegate: &mut Self::Delegate, col: usize, window: &mut Self::Window, cx: &mut Self::Cx<'_>) -> Option<f32>;+ fn visible_rows_changed(delegate: &mut Self::Delegate, rows: Range<usize>, window: &mut Self::Window, cx: &mut Self::Cx<'_>);+ fn visible_columns_changed(delegate: &mut Self::Delegate, cols: Range<usize>, window: &mut Self::Window, cx: &mut Self::Cx<'_>);+ fn has_more(delegate: &Self::Delegate, cx: &Self::Cx<'_>) -> bool;+ fn load_more_threshold(delegate: &Self::Delegate) -> usize;+ fn load_more(delegate: &mut Self::Delegate, window: &mut Self::Window, cx: &mut Self::Cx<'_>);+ fn write_clipboard(window: &mut Self::Window, cx: &mut Self::Cx<'_>, text: &str);+ /// Ask for a redraw from state changes made outside an input handler.+ fn notify(cx: &mut Self::Cx<'_>);+ /// Ask the window to redraw (the table paints from its state, so this is+ /// all a scroll needs).+ fn refresh(window: &mut Self::Window);+}++/// See the module docs.+pub struct TableCore<H: Host> {+ model: TableModel,+ delegate: H::Delegate,+ /// Events for the element's listeners (what the model raised, minus the+ /// ones that only ask the adapter to act).+ out: Vec<TableEvent>,+}++impl<H: Host> Deref for TableCore<H> {+ type Target = TableModel;+ fn deref(&self) -> &TableModel {+ &self.model+ }+}++impl<H: Host> DerefMut for TableCore<H> {+ fn deref_mut(&mut self) -> &mut TableModel {+ &mut self.model+ }+}++impl<H: Host> TableCore<H> {+ pub fn new(delegate: H::Delegate, cx: &H::Cx<'_>) -> Self {+ let mut s = Self { model: TableModel::new(), delegate, out: Vec::new() };+ s.reload(cx);+ s+ }++ // -- data ----------------------------------------------------------------------------------+ pub const fn delegate(&self) -> &H::Delegate {+ &self.delegate+ }++ pub const fn delegate_mut(&mut self) -> &mut H::Delegate {+ &mut self.delegate+ }++ /// Re-read the delegate's columns and row count (call after changing+ /// them). Keeps widths, order, scroll and sort where the columns still+ /// exist; the row filter is dropped when the row count changed.+ pub fn refresh(&mut self, cx: &mut H::Cx<'_>) {+ self.reload(cx);+ H::notify(cx);+ }++ fn reload(&mut self, cx: &H::Cx<'_>) {+ self.model.set_columns(H::columns(&self.delegate, cx), H::group_headers(&self.delegate, cx));+ self.model.set_loading(H::loading(&self.delegate, cx));+ self.model.set_rows(H::rows_count(&self.delegate, cx), &self.delegate);+ }++ /// Show only the rows `keep` accepts (an index mask: nothing is copied),+ /// keeping the current sort. Selection is cleared.+ pub fn set_filter(&mut self, keep: impl Fn(&H::Delegate, usize) -> bool, cx: &mut H::Cx<'_>) {+ let d = &self.delegate;+ self.model.set_filter(d, |r| keep(d, r));+ H::notify(cx);+ }++ /// Show every row again.+ pub fn clear_filter(&mut self, cx: &mut H::Cx<'_>) {+ self.model.clear_filter(&self.delegate);+ H::notify(cx);+ }++ /// Sort by source column `col` (what a header click does).+ pub fn sort_by(&mut self, col: usize, sort: ColumnSort, window: &mut H::Window, cx: &mut H::Cx<'_>) {+ self.model.sort_by(&self.delegate, col, sort, H::sort_by_mask(&self.delegate));+ self.answer_events(window, cx);+ H::notify(cx);+ }++ /// Answer what the model asked for (delegate hooks, the clipboard) and+ /// queue the rest for the element's listeners.+ fn answer_events(&mut self, window: &mut H::Window, cx: &mut H::Cx<'_>) {+ for e in self.model.take_events() {+ match &e {+ TableEvent::Sorted(col, sort) => H::perform_sort(&mut self.delegate, *col, *sort, window, cx),+ TableEvent::MoveColumn(_, to) => {+ let src = self.model.layout().src(*to);+ H::move_column(&mut self.delegate, src, *to, window, cx);+ }+ TableEvent::FitColumn(col) => {+ self.fit_col(*col, window, cx);+ continue;+ }+ TableEvent::Copied(text) => H::write_clipboard(window, cx, text),+ _ => {}+ }+ self.out.push(e);+ }+ }++ /// Events raised since the last call (the element hands them to its+ /// listeners; programmatic changes are collected here too).+ pub fn take_events(&mut self) -> Vec<TableEvent> {+ let mut v = std::mem::take(&mut self.out);+ v.extend(self.model.take_events());+ v+ }++ // -- frame -----------------------------------------------------------------------------------+ /// Called while rendering with the table's size: picks up data changes,+ /// keeps the scroll in range, tells the delegate what became visible and+ /// asks for more rows near the bottom.+ pub fn sync(&mut self, width: f32, height: f32, unit: f32, scale: f32, window: &mut H::Window, cx: &mut H::Cx<'_>) {+ self.model.set_loading(H::loading(&self.delegate, cx));+ if self.model.set_rows(H::rows_count(&self.delegate, cx), &self.delegate) {+ self.reload(cx);+ }+ let report = self.model.begin_frame(width, height, unit, scale);+ let changed = report.rows_changed.is_some() || report.cols_changed.is_some();+ if let Some(rows) = report.rows_changed {+ H::visible_rows_changed(&mut self.delegate, rows, window, cx);+ }+ if let Some(cols) = report.cols_changed {+ H::visible_columns_changed(&mut self.delegate, cols, window, cx);+ }+ let near_end = report.rows_left <= H::load_more_threshold(&self.delegate);+ if changed && near_end && H::has_more(&self.delegate, cx) && !self.model.loading() {+ H::load_more(&mut self.delegate, window, cx);+ }+ }++ // -- scrolling and selection (gpui-component's names) ---------------------------------------------+ /// Scroll so source row `row_ix` is in view.+ pub fn scroll_to_row(&mut self, row_ix: usize, cx: &mut H::Cx<'_>) {+ if self.model.scroll_to_row(row_ix) {+ H::notify(cx);+ }+ }++ /// Scroll so source column `col_ix` is in view.+ pub fn scroll_to_col(&mut self, col_ix: usize, cx: &mut H::Cx<'_>) {+ if self.model.scroll_to_col(col_ix) {+ H::notify(cx);+ }+ }++ pub fn set_right_clicked_row(&mut self, row: Option<usize>, cx: &mut H::Cx<'_>) {+ self.model.set_right_clicked_row(row);+ H::notify(cx);+ }++ pub fn set_selected_row(&mut self, row_ix: usize, cx: &mut H::Cx<'_>) {+ if self.model.set_selected_row(row_ix) {+ H::notify(cx);+ }+ }++ pub fn set_selected_col(&mut self, col_ix: usize, cx: &mut H::Cx<'_>) {+ self.model.set_selected_col(col_ix);+ H::notify(cx);+ }++ pub fn set_selected_cell(&mut self, row_ix: usize, col_ix: usize, cx: &mut H::Cx<'_>) {+ if self.model.set_selected_cell(row_ix, col_ix) {+ H::notify(cx);+ }+ }++ pub fn set_selection(&mut self, selection: TableSelection, cx: &mut H::Cx<'_>) {+ if self.model.set_selection(selection) {+ H::notify(cx);+ }+ }++ pub fn clear_selection(&mut self, cx: &mut H::Cx<'_>) {+ self.model.clear_selection();+ H::notify(cx);+ }++ /// Fit a column to its content through the delegate (double click on its+ /// border). Returns whether the width changed.+ pub fn fit_col(&mut self, col_ix: usize, window: &mut H::Window, cx: &mut H::Cx<'_>) -> bool {+ let Some(w) = H::fit_column(&mut self.delegate, col_ix, window, cx) else { return false };+ let changed = self.model.set_col_width(col_ix, w);+ if changed {+ H::notify(cx);+ }+ changed+ }++ // -- text ------------------------------------------------------------------------------------------+ /// The whole table as text (headers, rows in display order).+ pub fn dump(&self) -> (Vec<String>, Vec<Vec<String>>) {+ self.model.dump(&self.delegate)+ }++ /// Display rows `range` as text, with the headers.+ pub fn dump_range(&self, range: Range<usize>) -> (Vec<String>, Vec<Vec<String>>) {+ (self.model.headers(), self.model.dump_range(&self.delegate, range))+ }++ /// The selection as tab-separated text (what Ctrl+C copies).+ pub fn selection_text(&self) -> String {+ self.model.selection_text(&self.delegate)+ }++ /// State changed by input: re-render the view and repaint.+ fn redraw(window: &mut H::Window, cx: &mut H::Cx<'_>) {+ H::notify(cx);+ H::refresh(window);+ }++ // -- input (positions relative to the table) ----------------------------------------------------------+ /// Pointer pressed; `clicks` is the click count.+ pub fn pointer_down(&mut self, p: Point, button: Button, mods: Mods, clicks: usize, window: &mut H::Window, cx: &mut H::Cx<'_>) {+ self.model.pointer_down(p, button, mods, clicks);+ self.answer_events(window, cx);+ Self::redraw(window, cx);+ }++ /// Pointer moved. Returns whether the table redrew.+ pub fn pointer_move(&mut self, p: Point, window: &mut H::Window, cx: &mut H::Cx<'_>) -> bool {+ let redraw = self.model.pointer_move(p);+ if redraw {+ self.answer_events(window, cx);+ Self::redraw(window, cx);+ }+ redraw+ }++ /// Pointer released: finishes drags, and a header press that didn't+ /// move is a click (sort, or select the column).+ pub fn pointer_up(&mut self, window: &mut H::Window, cx: &mut H::Cx<'_>) {+ self.model.pointer_up(&self.delegate, H::sort_by_mask(&self.delegate));+ self.answer_events(window, cx);+ Self::redraw(window, cx);+ }++ /// Wheel: `lines` > 0 scrolls up. Shift scrolls sideways. Returns whether it moved.+ pub fn wheel(&mut self, lines: f32, shift: bool, window: &mut H::Window) -> bool {+ let px = self.model.wheel_pixels(lines);+ if shift { self.scroll_by_px(px, 0.0, window) } else { self.scroll_by_px(0.0, px, window) }+ }++ /// Scroll by pixels (positive: down / right; a touchpad's deltas). Returns whether it moved.+ pub fn scroll_by_px(&mut self, dx: f64, dy: f64, window: &mut H::Window) -> bool {+ let moved = self.model.scroll_by(dx, dy);+ if moved {+ H::refresh(window);+ }+ moved+ }++ /// A key while the table has focus. Returns whether it was handled.+ pub fn key_down(&mut self, key: Key, mods: Mods, window: &mut H::Window, cx: &mut H::Cx<'_>) -> bool {+ let handled = self.model.key_down(key, mods, &self.delegate);+ if handled {+ self.answer_events(window, cx);+ Self::redraw(window, cx);+ }+ handled+ }+}diff --git a/bindings/rust/blenderui-table/src/test_util.rs b/bindings/rust/blenderui-table/src/test_util.rsnew file mode 100644index 0000000..abd8062--- /dev/null+++ b/bindings/rust/blenderui-table/src/test_util.rs@@ -0,0 +1,3 @@+//! Seeded test helpers (shared: `blenderui-paint`).++pub use blenderui_paint::testing::Rng;diff --git a/bindings/rust/blenderui-table/src/vec_table.rs b/bindings/rust/blenderui-table/src/vec_table.rsnew file mode 100644index 0000000..acab2be--- /dev/null+++ b/bindings/rust/blenderui-table/src/vec_table.rs@@ -0,0 +1,67 @@+//! [`VecTable`]: a table's data as rows of strings, the convenience for+//! small tables and examples. Adapters implement their delegate trait for it.++use std::cmp::Ordering;++use crate::cell::{Cell, CellSource, SortKind};+use crate::column::Column;++/// Columns and rows of strings. Sortable columns sort by text, as numbers+/// when both cells parse as numbers.+#[derive(Clone, Debug, Default)]+pub struct VecTable {+ pub columns: Vec<Column>,+ pub rows: Vec<Vec<String>>,+}++impl VecTable {+ #[must_use]+ pub const fn new(columns: Vec<Column>, rows: Vec<Vec<String>>) -> Self {+ Self { columns, rows }+ }+}++impl CellSource for VecTable {+ fn cell(&self, row: usize, col: usize) -> Cell<'_> {+ self.rows.get(row).and_then(|r| r.get(col)).map_or(Cell::Empty, |s| Cell::Str(s))+ }++ fn sort_kind(&self, _: usize) -> SortKind {+ SortKind::Custom+ }++ fn compare(&self, col: usize, a: usize, b: usize) -> Ordering {+ let (x, y) = (self.cell(a, col), self.cell(b, col));+ let (Cell::Str(p), Cell::Str(q)) = (x, y) else { return x.sort_cmp(&y) };+ match (p.trim().parse::<f64>(), q.trim().parse::<f64>()) {+ (Ok(m), Ok(n)) => m.total_cmp(&n),+ _ => p.cmp(q),+ }+ }+}++#[cfg(test)]+mod tests {+ use super::*;+ use crate::mask::RowMask;+ use crate::sort::sorted_by_column;++ #[test]+ fn numbers_sort_numerically_and_text_lexically() {+ let order = |cells: &[&str]| {+ let rows = cells.iter().map(|s| vec![(*s).to_owned()]).collect();+ let t = VecTable::new(vec![Column::new("a", "A")], rows);+ let m = sorted_by_column(&t, 0, &RowMask::Identity, cells.len(), false);+ m.indices().unwrap().iter().map(|&r| t.rows[r as usize][0].clone()).collect::<Vec<_>>()+ };+ assert_eq!(order(&["10", "9", "100", "2", " 3 "]), vec!["2", " 3 ", "9", "10", "100"]);+ assert_eq!(order(&["b", "a", "B", "ab"]), vec!["B", "a", "ab", "b"]);+ }++ #[test]+ fn missing_cells_are_empty() {+ let t = VecTable::new(vec![], vec![vec!["a".into()]]);+ assert_eq!(t.cell(0, 5), Cell::Empty);+ assert_eq!(t.cell(9, 0), Cell::Empty);+ }+}diff --git a/bindings/rust/blenderui-table/src/visible.rs b/bindings/rust/blenderui-table/src/visible.rsnew file mode 100644index 0000000..f7f4a6c--- /dev/null+++ b/bindings/rust/blenderui-table/src/visible.rs@@ -0,0 +1,162 @@+//! Which rows and columns are on screen: the one place this math lives.+//!+//! Blender's spreadsheet draws a fixed-height row table by computing the+//! visible rows from the scroll offset (`get_visible_rows` in+//! `spreadsheet_draw.cc`: `first_row = scroll_y / row_height`,+//! `max_visible_rows = region_h / row_height + 1`) and skipping columns that+//! are off the region (`draw_spreadsheet_cells`: draw when+//! `right_x >= left_edge && left_x <= region_w`). Cost per frame is+//! O(visible cells), independent of the row count. [`uniform_list`] and+//! [`DataTable`] both use these functions.+//!+//! All math is `f64` with saturating casts, so a billion rows or a NaN+//! offset can neither overflow nor panic.+//!+//! [`uniform_list`]: crate::uniform_list+//! [`DataTable`]: crate::table::DataTable++use std::ops::Range;++/// The rows (`first..end`) a region `view_h` tall shows, scrolled `scroll_y`+/// px down, when every row is `row_h` px tall: Blender's `get_visible_rows`+/// made exact for fractional scrolls (the row cut at the bottom edge counts)+/// and clamped to `tot_rows`.+#[must_use]+pub fn visible_rows(scroll_y: f64, row_h: f64, view_h: f64, tot_rows: usize) -> Range<usize> {+ if tot_rows == 0 || row_h.partial_cmp(&0.0) != Some(std::cmp::Ordering::Greater) || view_h.partial_cmp(&0.0) != Some(std::cmp::Ordering::Greater) {+ return 0..0;+ }+ let top = if scroll_y > 0.0 { scroll_y } else { 0.0 };+ let first = ((top / row_h) as usize).min(tot_rows);+ let end = (((top + view_h) / row_h).ceil() as usize).min(tot_rows);+ first..end.max(first)+}++/// The largest scroll offset: the content ends at the region's bottom.+#[must_use]+pub fn max_scroll(tot: usize, item: f64, view: f64) -> f64 {+ let m = tot as f64 * item - view;+ if m > 0.0 { m } else { 0.0 }+}++/// `scroll` limited to `0..=max_scroll` (NaN becomes 0).+#[must_use]+pub fn clamp_scroll(scroll: f64, tot: usize, item: f64, view: f64) -> f64 {+ if scroll.is_nan() { 0.0 } else { scroll.clamp(0.0, max_scroll(tot, item, view)) }+}++/// The scroll offset that brings item `ix` fully into view from `scroll`+/// (unchanged when it already is).+#[must_use]+pub fn scroll_to_show(scroll: f64, ix: usize, item: f64, view: f64) -> f64 {+ let top = ix as f64 * item;+ let bottom = top + item;+ if top < scroll {+ top+ } else if bottom > scroll + view {+ bottom - view+ } else {+ scroll+ }+}++/// Columns of a strip of consecutive columns (`x[i]` = left edge of column+/// `i`, `x[n]` = the right edge of the last: `n + 1` entries) that+/// intersect `lo..hi` (view coordinates, already shifted by the scroll):+/// Blender's column culling, in `O(log n + visible)` by bisection.+#[must_use]+pub fn visible_cols(x: &[f32], lo: f32, hi: f32) -> Range<usize> {+ let n = x.len().saturating_sub(1);+ if n == 0 || hi.partial_cmp(&lo) != Some(std::cmp::Ordering::Greater) {+ return 0..0;+ }+ // first column whose right edge reaches `lo`; first whose left edge passes `hi`+ let first = x[1..].partition_point(|&r| r < lo).min(n);+ let end = x[..n].partition_point(|&l| l <= hi);+ first..end.max(first)+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn empty_and_degenerate() {+ assert_eq!(visible_rows(0.0, 20.0, 100.0, 0), 0..0);+ assert_eq!(visible_rows(0.0, 0.0, 100.0, 10), 0..0);+ assert_eq!(visible_rows(0.0, -1.0, 100.0, 10), 0..0);+ assert_eq!(visible_rows(0.0, 20.0, 0.0, 10), 0..0);+ assert_eq!(visible_rows(f64::NAN, 20.0, 100.0, 10), 0..5);+ assert_eq!(visible_rows(0.0, f64::NAN, 100.0, 10), 0..0);+ assert_eq!(visible_rows(0.0, 20.0, f64::NAN, 10), 0..0);+ }++ #[test]+ fn fewer_rows_than_viewport() {+ assert_eq!(visible_rows(0.0, 20.0, 1000.0, 3), 0..3);+ }++ #[test]+ fn fractional_scroll_counts_the_cut_row() {+ // rows 0.5 .. 5.5 of 20px rows: six rows touch the region+ assert_eq!(visible_rows(10.0, 20.0, 100.0, 100), 0..6);+ assert_eq!(visible_rows(40.0, 20.0, 100.0, 100), 2..7);+ for s in 0..400 {+ let r = visible_rows(f64::from(s) * 0.37, 20.0, 103.0, 1000);+ assert!(r.len() <= (103 / 20) + 2);+ }+ }++ #[test]+ fn scroll_past_end_and_huge() {+ assert_eq!(visible_rows(1e9, 20.0, 100.0, 10), 10..10);+ assert_eq!(visible_rows(f64::INFINITY, 20.0, 100.0, 10), 10..10);+ assert_eq!(visible_rows(-50.0, 20.0, 100.0, 10), 0..5);+ let r = visible_rows(1e15, 24.0, 600.0, usize::MAX);+ assert!(r.start < r.end && r.len() <= 27);+ assert_eq!(clamp_scroll(1e30, 10, 20.0, 100.0), 100.0);+ assert_eq!(clamp_scroll(f64::NAN, 10, 20.0, 100.0), 0.0);+ assert_eq!(max_scroll(5, 20.0, 1000.0), 0.0);+ // past i32::MAX pixels: 100M rows * 24 px+ let r = visible_rows(2.4e9 - 48.0, 24.0, 48.0, 100_000_000);+ assert_eq!(r, 99_999_998..100_000_000);+ }++ #[test]+ fn resize_keeps_first_row() {+ let a = visible_rows(200.0, 20.0, 100.0, 100);+ let b = visible_rows(200.0, 20.0, 300.0, 100);+ assert_eq!(a.start, b.start);+ assert!(b.len() > a.len());+ }++ #[test]+ fn show_item() {+ assert_eq!(scroll_to_show(0.0, 10, 20.0, 100.0), 120.0);+ assert_eq!(scroll_to_show(300.0, 2, 20.0, 100.0), 40.0);+ assert_eq!(scroll_to_show(40.0, 3, 20.0, 100.0), 40.0);+ }++ #[test]+ fn culling_matches_naive() {+ let widths = [30.0f32, 50.0, 20.0, 80.0, 10.0, 60.0];+ let mut x = vec![0.0f32];+ for w in widths {+ x.push(x.last().unwrap() + w);+ }+ for lo in (-20..260).step_by(7) {+ for len in [0, 1, 40, 90, 400] {+ let (lo, hi) = (lo as f32, (lo + len) as f32);+ let naive: Vec<usize> = (0..widths.len()).filter(|&i| x[i + 1] >= lo && x[i] <= hi).collect();+ let r = visible_cols(&x, lo, hi);+ if hi > lo {+ assert_eq!(r.collect::<Vec<_>>(), naive, "lo {lo} hi {hi}");+ } else {+ assert!(r.is_empty());+ }+ }+ }+ assert_eq!(visible_cols(&[], 0.0, 10.0), 0..0);+ assert_eq!(visible_cols(&[0.0], 0.0, 10.0), 0..0);+ }+}diff --git a/bindings/rust/blenderui-table/tests/model.rs b/bindings/rust/blenderui-table/tests/model.rsnew file mode 100644index 0000000..6c31893--- /dev/null+++ b/bindings/rust/blenderui-table/tests/model.rs@@ -0,0 +1,346 @@+#![allow(clippy::float_cmp, clippy::many_single_char_names)]+//! The model end to end through its public API: input, sorting, selection,+//! keyboard navigation, copying, extreme sizes and a randomized event soak.++use blenderui_table::{+ Button, Cell, CellSource, Column, ColumnSort, Hit, Key, Mods, Point, TableEvent, TableModel, TableSelection,+};++/// `rows` x 5; column 0 is the row, 1 a sparse value, 2 text with a tab, 3 a float.+struct Data;++const fn val(r: usize) -> u64 {+ (r as u64 * 2_654_435_761) % 997+}++impl CellSource for Data {+ fn cell(&self, r: usize, c: usize) -> Cell<'_> {+ match c {+ 0 => Cell::U64(r as u64),+ 1 => Cell::U64(val(r)),+ 2 => Cell::Str(if r.is_multiple_of(2) { "a\tb" } else { "plain" }),+ 3 => Cell::F64(r as f64 / 4.0, 2),+ _ => Cell::Empty,+ }+ }+}++const NONE: Mods = Mods { shift: false, control: false, alt: false };+const SHIFT: Mods = Mods { shift: true, control: false, alt: false };+const CTRL: Mods = Mods { shift: false, control: true, alt: false };+const HEADER: f32 = 22.0;+const ROW: f32 = 20.0;++fn table(rows: usize) -> TableModel {+ let mut t = TableModel::new();+ let cols = vec![+ Column::new("id", "ID").sortable().width(80.0_f32).fixed_left(),+ Column::new("v", "V").sortable().width(100.0_f32),+ Column::new("t", "T").sortable().width(100.0_f32),+ Column::new("f", "F").sortable().width(100.0_f32),+ Column::new("e", "E").width(100.0_f32),+ ];+ t.set_columns(cols, None);+ t.set_rows(rows, &Data);+ t.begin_frame(400.0, 200.0, 20.0, 1.0);+ t+}++fn click(t: &mut TableModel, x: f32, y: f32, mods: Mods) {+ t.pointer_down(Point { x, y }, Button::Left, mods, 1);+ t.pointer_up(&Data, true);+}++fn row_y(r: usize) -> f32 {+ HEADER + ROW * r as f32 + ROW / 2.0+}++#[test]+fn clicks_select_rows_with_modifiers() {+ let mut t = table(50);+ click(&mut t, 200.0, row_y(2), NONE);+ assert_eq!(t.selected_row(), Some(2));+ click(&mut t, 200.0, row_y(5), SHIFT);+ assert_eq!(t.selected_rows().collect::<Vec<_>>(), vec![2, 3, 4, 5]);+ click(&mut t, 200.0, row_y(0), CTRL);+ assert_eq!(t.selected_rows().count(), 5);+ assert_eq!(t.selection(), TableSelection::Row(0));+ let events = t.take_events();+ assert!(events.contains(&TableEvent::SelectRow(2)));+ assert!(t.take_events().is_empty());+}++#[test]+fn keyboard_navigation_wraps_extends_and_pages() {+ let mut t = table(30);+ assert!(t.key_down(Key::Down, NONE, &Data));+ assert_eq!(t.selected_row(), Some(0));+ assert!(t.key_down(Key::Up, NONE, &Data)); // wraps to the last+ assert_eq!(t.selected_row(), Some(29));+ assert!(t.key_down(Key::Down, NONE, &Data)); // and back+ assert_eq!(t.selected_row(), Some(0));+ t.key_down(Key::PageDown, NONE, &Data);+ assert_eq!(t.selected_row(), Some(8)); // (200 - 22) / 20 = 8 rows per page+ t.key_down(Key::Down, SHIFT, &Data);+ t.key_down(Key::Down, SHIFT, &Data);+ assert_eq!(t.selected_rows().collect::<Vec<_>>(), vec![8, 9, 10]);+ t.key_down(Key::End, NONE, &Data);+ assert_eq!(t.selected_row(), Some(29));+ t.key_down(Key::Down, SHIFT, &Data); // no wrap while extending+ assert_eq!(t.selected_row(), Some(29));+ t.key_down(Key::Home, NONE, &Data);+ assert_eq!(t.selected_row(), Some(0));+ // the selected row is always scrolled into view+ t.key_down(Key::End, NONE, &Data);+ let g = t.geo();+ let (_, sy) = t.scroll_offset();+ assert!((sy + f64::from(g.body_h)) >= 30.0 * f64::from(g.row_h) - 1.0);+ assert!(t.key_down(Key::A, CTRL, &Data));+ assert_eq!(t.selected_rows().count(), 30);+ assert!(t.key_down(Key::Escape, NONE, &Data));+ assert_eq!(t.selected_rows().count(), 0);+ assert!(!t.key_down(Key::Other, NONE, &Data));+}++#[test]+fn navigation_on_an_empty_table_does_nothing() {+ let mut t = table(0);+ for k in [Key::Down, Key::Up, Key::PageDown, Key::Home, Key::End] {+ t.key_down(k, NONE, &Data);+ assert_eq!(t.selected_row(), None);+ }+ t.key_down(Key::A, CTRL, &Data);+ assert_eq!(t.selected_rows().count(), 0);+}++#[test]+fn left_right_move_the_cell_selection_between_columns() {+ let mut t = table(10);+ t.opts.cell_selectable = true;+ t.set_selected_cell(3, 1);+ t.key_down(Key::Right, NONE, &Data);+ // view order: id (pinned), v, t, f, e+ assert_eq!(t.selected_cell(), Some((3, 2)));+ t.key_down(Key::Left, NONE, &Data);+ t.key_down(Key::Left, NONE, &Data);+ assert_eq!(t.selected_cell(), Some((3, 0)));+ t.key_down(Key::Left, NONE, &Data); // wraps+ assert_eq!(t.selected_cell(), Some((3, 4)));+ t.opts.loop_selection = false;+ t.key_down(Key::Right, NONE, &Data);+ assert_eq!(t.selected_cell(), Some((3, 4)));+}++#[test]+fn header_click_sorts_by_mask_and_cycles() {+ let mut t = table(5000);+ let hy = HEADER / 2.0;+ let min = (0..5000).map(val).min().unwrap();+ click(&mut t, 130.0, hy, NONE); // the V column starts at 80+ assert_eq!(t.sorted_by(), Some((1, ColumnSort::Ascending)));+ assert_eq!(val(t.row_at(0)), min);+ assert!((0..4999).all(|i| val(t.row_at(i)) <= val(t.row_at(i + 1))));+ click(&mut t, 130.0, hy, NONE);+ assert_eq!(t.sorted_by(), Some((1, ColumnSort::Descending)));+ assert!((0..4999).all(|i| val(t.row_at(i)) >= val(t.row_at(i + 1))));+ click(&mut t, 130.0, hy, NONE);+ assert_eq!(t.sorted_by(), None);+ assert_eq!(t.row_at(7), 7);+ let sorts = t.take_events().into_iter().filter(|e| matches!(e, TableEvent::Sorted(..))).count();+ assert_eq!(sorts, 3);+}++#[test]+fn a_filter_composes_with_the_sort_and_shows_the_right_rows() {+ let mut t = table(1000);+ click(&mut t, 130.0, HEADER / 2.0, NONE);+ t.set_filter(&Data, |r| r % 10 == 0);+ assert_eq!(t.rows(), 100);+ assert!((0..99).all(|i| val(t.row_at(i)) <= val(t.row_at(i + 1))));+ assert!((0..100).all(|i| t.row_at(i).is_multiple_of(10)));+ t.clear_filter(&Data);+ assert_eq!(t.rows(), 1000);+ // selection maps display rows to data rows through the mask+ t.set_selected_row(500);+ assert_eq!(t.selected_row(), Some(500));+}++#[test]+fn copy_is_tsv_in_display_order_with_cells_sanitized() {+ let mut t = table(6);+ click(&mut t, 200.0, row_y(0), NONE);+ click(&mut t, 200.0, row_y(1), SHIFT);+ assert!(t.key_down(Key::C, CTRL, &Data));+ let copied = t.take_events().into_iter().find_map(|e| if let TableEvent::Copied(s) = e { Some(s) } else { None });+ let text = copied.expect("a copy event");+ let lines: Vec<&str> = text.lines().collect();+ assert_eq!(lines.len(), 2);+ // pinned id first, then v, the text with its tab turned into a space, the float, the empty cell+ let cells: Vec<&str> = lines[0].split('\t').collect();+ assert_eq!(cells, vec!["0", &val(0).to_string(), "a b", "0.00", ""]);+ assert_eq!(lines[1].split('\t').nth(3), Some("0.25"));+ // nothing selected: nothing copied+ t.key_down(Key::Escape, NONE, &Data);+ t.take_events();+ t.key_down(Key::C, CTRL, &Data);+ assert!(t.take_events().iter().all(|e| !matches!(e, TableEvent::Copied(_))));+}++#[test]+fn dragging_a_border_resizes_and_a_double_click_asks_for_a_fit() {+ let mut t = table(100);+ t.take_events();+ t.pointer_down(Point { x: 80.0, y: 10.0 }, Button::Left, NONE, 1);+ assert!(t.pointer_move(Point { x: 130.0, y: 10.0 }));+ t.pointer_up(&Data, true);+ assert_eq!(t.col_width(0), Some(130.0));+ t.pointer_down(Point { x: 130.0, y: 10.0 }, Button::Left, NONE, 1);+ t.pointer_move(Point { x: 1.0, y: 10.0 });+ t.pointer_up(&Data, true);+ assert_eq!(t.col_width(0), Some(20.0), "clamped to the minimum width");+ let events = t.take_events();+ assert!(events.iter().any(|e| matches!(e, TableEvent::ColumnWidthsChanged(w) if w[0] == 130.0)));+ t.pointer_down(Point { x: 20.0, y: 10.0 }, Button::Left, NONE, 2);+ assert_eq!(t.take_events(), vec![TableEvent::FitColumn(0)]);+ assert!(t.set_col_width(0, 64.0));+ assert_eq!(t.col_width(0), Some(64.0));+}++#[test]+fn dragging_a_header_moves_the_column_inside_its_strip() {+ let mut t = table(10);+ let (x1, x2) = (80.0 + 50.0, 80.0 + 250.0); // V, then F+ t.pointer_down(Point { x: x1, y: 10.0 }, Button::Left, NONE, 1);+ assert!(t.pointer_move(Point { x: x2, y: 10.0 }));+ t.pointer_up(&Data, true);+ assert_eq!(t.layout().column(3).key, "v");+ assert!(t.take_events().iter().any(|e| matches!(e, TableEvent::MoveColumn(1, 3))));+ // the pinned column cannot leave the pinned strip+ t.pointer_down(Point { x: 40.0, y: 10.0 }, Button::Left, NONE, 1);+ t.pointer_move(Point { x: 300.0, y: 10.0 });+ t.pointer_up(&Data, true);+ assert_eq!(t.layout().column(0).key, "id");+}++#[test]+fn wheel_scrolls_three_rows_per_line_and_shift_goes_sideways() {+ let mut t = table(1000);+ assert!(t.scroll_by(0.0, t.wheel_pixels(-1.0)));+ assert_eq!(t.scroll_offset().1, 60.0);+ t.scroll_by(0.0, t.wheel_pixels(5.0));+ assert_eq!(t.scroll_offset().1, 0.0);+ assert!(t.scroll_by(t.wheel_pixels(-1.0), 0.0));+ assert!(t.scroll_offset().0 > 0.0);+}++#[test]+fn scrolling_reports_what_became_visible() {+ let mut t = table(100_000);+ let r = t.begin_frame(400.0, 200.0, 20.0, 1.0);+ assert!(r.rows_changed.is_none() && r.cols_changed.is_none(), "nothing changed since the first frame");+ t.scroll_by(0.0, 20_000.0);+ let r = t.begin_frame(400.0, 200.0, 20.0, 1.0);+ assert_eq!(r.rows_changed.map(|r| r.start), Some(1000));+ assert!(r.rows_left > 90_000);+ assert!(t.scroll_to_row(5));+ assert!(!t.scroll_to_row(100_000));+ assert!(t.scroll_to_col(4));+ assert!(!t.scroll_to_col(0), "a pinned column never needs scrolling to");+}++#[test]+fn extreme_sizes_do_not_overflow_or_panic() {+ // a billion rows: the identity mask stores nothing+ let mut t = TableModel::new();+ t.set_columns(vec![Column::new("a", "A").width(100.0_f32)], None);+ t.set_rows(usize::MAX / 4, &Data);+ t.begin_frame(400.0, 200.0, 20.0, 1.0);+ t.scroll_by(0.0, 1e300);+ t.scroll_by(f64::NAN, f64::NAN);+ t.scroll_by(f64::INFINITY, f64::NEG_INFINITY);+ t.begin_frame(400.0, 200.0, 20.0, 1.0);+ let v = t.visible_range().rows().clone();+ assert!(v.start <= v.end && v.end <= t.rows());+ t.key_down(Key::End, NONE, &Data);+ t.key_down(Key::PageUp, NONE, &Data);+ // a zero-sized and a negative-sized table+ for (w, h) in [(0.0, 0.0), (-5.0, -5.0), (f32::NAN, 100.0), (1e9, 1e9)] {+ t.begin_frame(w, h, 20.0, 1.0);+ let _ = t.hit(Point { x: 3.0, y: 3.0 });+ }+ t.begin_frame(400.0, 200.0, 0.0, 0.0);+ assert!(t.geo().row_h >= 1.0);+}++#[test]+fn hit_testing_agrees_with_geometry() {+ let mut t = table(100);+ assert_eq!(t.hit(Point { x: 5.0, y: 5.0 }), Hit::Header(0));+ assert_eq!(t.hit(Point { x: 5.0, y: row_y(0) }), Hit::Cell(0, 0));+ assert_eq!(t.hit(Point { x: 200.0, y: row_y(3) }), Hit::Cell(3, 2));+ assert_eq!(t.hit(Point { x: -1.0, y: 5.0 }), Hit::None);+ assert_eq!(t.hit(Point { x: 80.0, y: 5.0 }), Hit::Border(0));+ t.scroll_by(0.0, 100.0);+ assert_eq!(t.hit(Point { x: 5.0, y: row_y(0) }), Hit::Cell(5, 0));+ assert!(!t.header_handles().is_empty());+}++/// A randomized soak: whatever the events, the model's invariants hold.+#[test]+fn random_events_keep_the_invariants() {+ struct Rng(u64);+ impl Rng {+ fn next(&mut self) -> u64 {+ self.0 ^= self.0 << 13;+ self.0 ^= self.0 >> 7;+ self.0 ^= self.0 << 17;+ self.0+ }+ fn f(&mut self, max: f32) -> f32 {+ (self.next() % 10_000) as f32 / 10_000.0 * max+ }+ }+ let keys = [Key::Up, Key::Down, Key::Left, Key::Right, Key::PageUp, Key::PageDown, Key::Home, Key::End, Key::Escape, Key::A, Key::C];+ for seed in 1..=8u64 {+ let mut rng = Rng(seed * 7919);+ let mut t = table([0usize, 1, 7, 300, 20_000][(seed % 5) as usize]);+ t.opts.cell_selectable = seed % 2 == 0;+ t.opts.col_selectable = seed % 3 == 0;+ t.opts.row_header = seed % 4 == 0;+ for _ in 0..3000 {+ let p = Point { x: rng.f(450.0) - 10.0, y: rng.f(260.0) - 10.0 };+ let mods = Mods { shift: rng.next().is_multiple_of(2), control: rng.next().is_multiple_of(3), alt: false };+ match rng.next() % 8 {+ 0 => t.pointer_down(p, Button::Left, mods, 1 + (rng.next() % 2) as usize),+ 1 => t.pointer_down(p, Button::Right, mods, 1),+ 2 => {+ t.pointer_move(p);+ }+ 3 => t.pointer_up(&Data, rng.next().is_multiple_of(2)),+ 4 => {+ let px = t.wheel_pixels(rng.f(10.0) - 5.0);+ t.scroll_by(if mods.shift { px } else { 0.0 }, if mods.shift { 0.0 } else { px });+ }+ 5 => {+ t.key_down(keys[(rng.next() % keys.len() as u64) as usize], mods, &Data);+ }+ 6 => {+ t.begin_frame(100.0 + rng.f(400.0), 50.0 + rng.f(300.0), 20.0, 1.0);+ }+ _ => {+ t.take_events();+ }+ }+ let rows = t.rows();+ for r in t.selected_ranges() {+ assert!(r.start < r.end && r.end <= rows, "seed {seed}: {r:?} of {rows}");+ }+ let (sx, sy) = t.scroll_offset();+ assert!(sx >= 0.0 && sy >= 0.0 && sx.is_finite() && sy.is_finite());+ let g = t.geo();+ assert!(sy <= (rows as f64 * f64::from(g.row_h)).max(0.0), "scrolled past the end");+ let v = t.visible_range().rows();+ assert!(v.end <= rows);+ }+ }+}diff --git a/bindings/rust/blenderui-vlist-gpui/Cargo.lock b/bindings/rust/blenderui-vlist-gpui/Cargo.locknew file mode 100644index 0000000..8afdbe7--- /dev/null+++ b/bindings/rust/blenderui-vlist-gpui/Cargo.lock@@ -0,0 +1,8385 @@+# This file is automatically @generated by Cargo.+# It is not intended for manual editing.+version = 4++[[package]]+name = "accesskit"+version = "0.24.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d3b7f7f85a7e5f68090000ed7622545829afd484d210358702ae4cb97dd0c320"+dependencies = [+ "enumn",+ "uuid",+]++[[package]]+name = "accesskit_consumer"+version = "0.38.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d10a236f96f87d70732e44520046785431ef01d5bcd6b041317bfadd2f88245"+dependencies = [+ "accesskit",+ "hashbrown 0.16.1",+]++[[package]]+name = "accesskit_macos"+version = "0.26.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ce02dc63b43f0c9296af9ac946312a2dc8814427d7a64d2d600971dac55b6076"+dependencies = [+ "accesskit",+ "accesskit_consumer",+ "hashbrown 0.16.1",+ "objc2 0.5.3",+ "objc2-app-kit 0.2.2",+ "objc2-foundation 0.2.2",+]++[[package]]+name = "accesskit_windows"+version = "0.34.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "106c2b961215864d1c2e703ee63269c25c4e80a577ffb2c1017b9c17dcdf83a1"+dependencies = [+ "accesskit",+ "accesskit_consumer",+ "hashbrown 0.16.1",+ "static_assertions",+ "windows 0.62.2",+ "windows-core 0.62.2",+]++[[package]]+name = "addr2line"+version = "0.27.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e567177890eb1617b1f774005b66b26b2377afd138a2ca37aae7d8f0c81429d4"+dependencies = [+ "gimli",+]++[[package]]+name = "adler2"+version = "2.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"++[[package]]+name = "aes"+version = "0.8.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"+dependencies = [+ "cfg-if",+ "cipher",+ "cpufeatures 0.2.17",+ "zeroize",+]++[[package]]+name = "aho-corasick"+version = "1.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"+dependencies = [+ "memchr",+]++[[package]]+name = "aligned"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685"+dependencies = [+ "as-slice",+]++[[package]]+name = "aligned-vec"+version = "0.6.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b"+dependencies = [+ "equator",+]++[[package]]+name = "alloca"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4"+dependencies = [+ "cc",+]++[[package]]+name = "allocator-api2"+version = "0.2.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"++[[package]]+name = "android_system_properties"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc"+dependencies = [+ "libc",+]++[[package]]+name = "anes"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"++[[package]]+name = "annotate-snippets"+version = "0.12.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b2a5b0a5ab8561c603f16c3b78c24a386b1f70e7fc1b1b1e8c15738828e4a176"+dependencies = [+ "anstyle",+ "memchr",+ "unicode-width",+]++[[package]]+name = "anstyle"+version = "1.0.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"++[[package]]+name = "anyhow"+version = "1.0.104"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"++[[package]]+name = "arbitrary"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed"++[[package]]+name = "arc-swap"+version = "1.9.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "380962b3d93b99642e50b9febf72c071e97e8b32d86eae9cf4ef582bb960ae6e"+dependencies = [+ "rustversion",+]++[[package]]+name = "arg_enum_proc_macro"+version = "0.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "arraydeque"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236"++[[package]]+name = "arrayref"+version = "0.3.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"++[[package]]+name = "arrayvec"+version = "0.7.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"++[[package]]+name = "as-slice"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516"+dependencies = [+ "stable_deref_trait",+]++[[package]]+name = "ash"+version = "0.38.0+1.3.281"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f"+dependencies = [+ "libloading",+]++[[package]]+name = "ashpd"+version = "0.13.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fb8421aaa9644a5faf26735f258b669b15f063313ef8f8e2bdb28912a1a6f111"+dependencies = [+ "enumflags2",+ "futures-util",+ "getrandom 0.4.3",+ "serde",+ "zbus",+]++[[package]]+name = "async-broadcast"+version = "0.7.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"+dependencies = [+ "event-listener",+ "event-listener-strategy",+ "futures-core",+ "pin-project-lite",+]++[[package]]+name = "async-channel"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"+dependencies = [+ "concurrent-queue",+ "event-listener-strategy",+ "futures-core",+ "pin-project-lite",+]++[[package]]+name = "async-executor"+version = "1.14.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f426a31126c735126297bc5ea7a521263c9faff4f63ca415267ee625651c4f37"+dependencies = [+ "async-task",+ "concurrent-queue",+ "fastrand",+ "futures-lite",+ "pin-project-lite",+ "slab",+]++[[package]]+name = "async-fs"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5"+dependencies = [+ "async-lock",+ "blocking",+ "futures-lite",+]++[[package]]+name = "async-io"+version = "2.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"+dependencies = [+ "autocfg",+ "cfg-if",+ "concurrent-queue",+ "futures-io",+ "futures-lite",+ "parking",+ "polling",+ "rustix",+ "slab",+ "windows-sys 0.61.2",+]++[[package]]+name = "async-lock"+version = "3.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0876700b0d007ad25d5508865a4259c3af9af6d296bf663a0d586d0bc3369f6f"+dependencies = [+ "event-listener",+ "event-listener-strategy",+ "pin-project-lite",+]++[[package]]+name = "async-net"+version = "2.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7"+dependencies = [+ "async-io",+ "blocking",+ "futures-lite",+]++[[package]]+name = "async-process"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"+dependencies = [+ "async-channel",+ "async-io",+ "async-lock",+ "async-signal",+ "async-task",+ "blocking",+ "cfg-if",+ "event-listener",+ "futures-lite",+ "rustix",+]++[[package]]+name = "async-recursion"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "async-signal"+version = "0.2.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"+dependencies = [+ "async-io",+ "async-lock",+ "atomic-waker",+ "cfg-if",+ "futures-core",+ "futures-io",+ "rustix",+ "signal-hook-registry",+ "slab",+ "windows-sys 0.61.2",+]++[[package]]+name = "async-task"+version = "4.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"++[[package]]+name = "async-trait"+version = "0.1.92"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "atomic"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba"++[[package]]+name = "atomic-waker"+version = "1.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"++[[package]]+name = "autocfg"+version = "1.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"++[[package]]+name = "av-scenechange"+version = "0.14.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394"+dependencies = [+ "aligned",+ "anyhow",+ "arg_enum_proc_macro",+ "arrayvec",+ "log",+ "num-rational",+ "num-traits",+ "pastey",+ "rayon",+ "thiserror 2.0.21",+ "v_frame",+ "y4m",+]++[[package]]+name = "av1-grain"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8"+dependencies = [+ "anyhow",+ "arrayvec",+ "log",+ "nom",+ "num-rational",+ "v_frame",+]++[[package]]+name = "avif-serialize"+version = "0.8.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e7178fe5f7d460b13895ebb9dcb28a3a6216d2df2574a0806cb51b555d297f38"+dependencies = [+ "arrayvec",+]++[[package]]+name = "backtrace"+version = "0.3.77"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "42f4220217f3288537b83684130f42fad43320b1c3b805f1910d683d52ded24f"+dependencies = [+ "addr2line",+ "cfg-if",+ "libc",+ "miniz_oxide 0.9.1",+ "object",+ "rustc-demangle",+ "windows-link 0.2.1",+]++[[package]]+name = "base62"+version = "2.2.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a3a647dce9631f152a99ec16cfc09267ae55fe280d5dc288964027d458076323"++[[package]]+name = "base64"+version = "0.22.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"++[[package]]+name = "base64"+version = "0.23.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"++[[package]]+name = "bit-set"+version = "0.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09ec2f926cc3060f09db9ebc5b52823d85268d24bb917e472c0c4bea35780a7d"+dependencies = [+ "bit-vec 0.9.1",+]++[[package]]+name = "bit-set"+version = "0.11.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "56d87354e4229f54a44f7bf2435906a4656dba36026ab6eaca629a2c436a691c"+dependencies = [+ "bit-vec 0.10.1",+]++[[package]]+name = "bit-vec"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51"++[[package]]+name = "bit-vec"+version = "0.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5727b15fa97d4f4fee0a3b7c3d550ed0269f54329207b86388de918604e31269"+dependencies = [+ "borsh",+ "serde",+]++[[package]]+name = "bit_field"+version = "0.10.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6"++[[package]]+name = "bitflags"+version = "1.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"++[[package]]+name = "bitflags"+version = "2.13.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"++[[package]]+name = "bitstream-io"+version = "4.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7eff00be299a18769011411c9def0d827e8f2d7bf0c3dbf53633147a8867fd1f"+dependencies = [+ "no_std_io2",+]++[[package]]+name = "blenderui-paint"+version = "0.2.0"++[[package]]+name = "blenderui-paint-gpui"+version = "0.2.0"+dependencies = [+ "blenderui-paint",+ "gpui-pre",+]++[[package]]+name = "blenderui-vlist"+version = "0.2.0"+dependencies = [+ "blenderui-paint",+]++[[package]]+name = "blenderui-vlist-gpui"+version = "0.2.0"+dependencies = [+ "blenderui-paint-gpui",+ "blenderui-vlist",+ "gpui-component",+ "gpui-kit-assets",+ "gpui-pre",+ "gpui-pre-platform",+]++[[package]]+name = "block"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"++[[package]]+name = "block-buffer"+version = "0.10.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"+dependencies = [+ "generic-array",+]++[[package]]+name = "block-buffer"+version = "0.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"+dependencies = [+ "hybrid-array",+]++[[package]]+name = "block-padding"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"+dependencies = [+ "generic-array",+]++[[package]]+name = "block2"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f"+dependencies = [+ "objc2 0.5.3",+]++[[package]]+name = "block2"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"+dependencies = [+ "objc2 0.6.5",+]++[[package]]+name = "blocking"+version = "1.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa"+dependencies = [+ "async-channel",+ "async-task",+ "futures-io",+ "futures-lite",+ "piper",+]++[[package]]+name = "borsh"+version = "1.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "553c5d846a6ba5150c65e3b1b8ec073bcf1abc20f9b7220de384a4443ea4e20a"+dependencies = [+ "borsh-derive",+ "bytes",+ "cfg_aliases",+]++[[package]]+name = "borsh-derive"+version = "1.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "12cdfe656708a01f89b451a7d36466e6fe6c414de0aa18fc54f864f6f9ca9f56"+dependencies = [+ "once_cell",+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "bstr"+version = "1.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f"+dependencies = [+ "memchr",+ "regex-automata",+ "serde_core",+]++[[package]]+name = "built"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9"++[[package]]+name = "bumpalo"+version = "3.20.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"++[[package]]+name = "bytemuck"+version = "1.25.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"+dependencies = [+ "bytemuck_derive",+]++[[package]]+name = "bytemuck_derive"+version = "1.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6a1f896587b6f2c069c73d2f0913e2d590c3990285cd2f0b6aa02b786b4c679c"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "byteorder"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"++[[package]]+name = "byteorder-lite"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"++[[package]]+name = "bytes"+version = "1.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"++[[package]]+name = "c-enum"+version = "0.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cd17eb909a8c6a894926bfcc3400a4bb0e732f5a57d37b1f14e8b29e329bace8"++[[package]]+name = "calloop"+version = "0.14.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "43b32313e937c8721c9d17ee9bf60699a6402b4b7c2cb6ac1bee0ffcaa4b4e5e"+dependencies = [+ "bitflags 2.13.2",+ "polling",+ "rustix",+ "tracing",+]++[[package]]+name = "cast"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"++[[package]]+name = "cbc"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6"+dependencies = [+ "cipher",+]++[[package]]+name = "cbindgen"+version = "0.28.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eadd868a2ce9ca38de7eeafdcec9c7065ef89b42b32f0839278d55f35c54d1ff"+dependencies = [+ "heck 0.4.1",+ "indexmap",+ "log",+ "proc-macro2",+ "quote",+ "serde",+ "serde_json",+ "syn 2.0.119",+ "tempfile",+ "toml 0.8.23",+]++[[package]]+name = "cc"+version = "1.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "375989decec1a0fa424442bed520fa12ede43a48475ce8c7417d2c69b32b5f6b"+dependencies = [+ "find-msvc-tools",+ "jobserver",+ "libc",+ "shlex",+]++[[package]]+name = "cfg-if"+version = "1.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"++[[package]]+name = "cfg_aliases"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"++[[package]]+name = "chacha20"+version = "0.10.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06"+dependencies = [+ "cfg-if",+ "cpufeatures 0.3.1",+ "rand_core 0.10.1",+]++[[package]]+name = "chrono"+version = "0.4.45"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327"+dependencies = [+ "iana-time-zone",+ "js-sys",+ "num-traits",+ "serde",+ "wasm-bindgen",+ "windows-link 0.2.1",+]++[[package]]+name = "ciborium"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e"+dependencies = [+ "ciborium-io",+ "ciborium-ll",+ "serde",+]++[[package]]+name = "ciborium-io"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757"++[[package]]+name = "ciborium-ll"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"+dependencies = [+ "ciborium-io",+ "half",+]++[[package]]+name = "cipher"+version = "0.4.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"+dependencies = [+ "crypto-common 0.1.7",+ "inout",+ "zeroize",+]++[[package]]+name = "clap"+version = "4.6.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946"+dependencies = [+ "clap_builder",+]++[[package]]+name = "clap_builder"+version = "4.6.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d"+dependencies = [+ "anstyle",+ "clap_lex",+]++[[package]]+name = "clap_lex"+version = "1.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486"++[[package]]+name = "cocoa"+version = "0.25.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c"+dependencies = [+ "bitflags 1.3.2",+ "block",+ "cocoa-foundation",+ "core-foundation 0.9.4",+ "core-graphics 0.23.2",+ "foreign-types",+ "libc",+ "objc",+]++[[package]]+name = "cocoa-foundation"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7"+dependencies = [+ "bitflags 1.3.2",+ "block",+ "core-foundation 0.9.4",+ "core-graphics-types 0.1.3",+ "libc",+ "objc",+]++[[package]]+name = "codespan-reporting"+version = "0.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681"+dependencies = [+ "serde",+ "termcolor",+ "unicode-width",+]++[[package]]+name = "color_quant"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"++[[package]]+name = "concurrent-queue"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"+dependencies = [+ "crossbeam-utils",+]++[[package]]+name = "console_error_panic_hook"+version = "0.1.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"+dependencies = [+ "cfg-if",+ "wasm-bindgen",+]++[[package]]+name = "const-oid"+version = "0.10.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c"++[[package]]+name = "convert_case"+version = "0.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9"+dependencies = [+ "unicode-segmentation",+]++[[package]]+name = "convert_case"+version = "0.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "affbf0190ed2caf063e3def54ff444b449371d55c58e513a95ab98eca50adb49"+dependencies = [+ "unicode-segmentation",+]++[[package]]+name = "core-foundation"+version = "0.9.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"+dependencies = [+ "core-foundation-sys",+ "libc",+]++[[package]]+name = "core-foundation"+version = "0.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"+dependencies = [+ "core-foundation-sys",+ "libc",+]++[[package]]+name = "core-foundation-sys"+version = "0.8.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"++[[package]]+name = "core-graphics"+version = "0.23.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081"+dependencies = [+ "bitflags 1.3.2",+ "core-foundation 0.9.4",+ "core-graphics-types 0.1.3",+ "foreign-types",+ "libc",+]++[[package]]+name = "core-graphics"+version = "0.24.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1"+dependencies = [+ "bitflags 2.13.2",+ "core-foundation 0.10.1",+ "core-graphics-types 0.2.0",+ "foreign-types",+ "libc",+]++[[package]]+name = "core-graphics-helmer-fork"+version = "0.24.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32eb7c354ae9f6d437a6039099ce7ecd049337a8109b23d73e48e8ffba8e9cd5"+dependencies = [+ "bitflags 2.13.2",+ "core-foundation 0.9.4",+ "core-graphics-types 0.1.3",+ "foreign-types",+ "libc",+]++[[package]]+name = "core-graphics-types"+version = "0.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf"+dependencies = [+ "bitflags 1.3.2",+ "core-foundation 0.9.4",+ "libc",+]++[[package]]+name = "core-graphics-types"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"+dependencies = [+ "bitflags 2.13.2",+ "core-foundation 0.10.1",+ "libc",+]++[[package]]+name = "core-text"+version = "21.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a593227b66cbd4007b2a050dfdd9e1d1318311409c8d600dc82ba1b15ca9c130"+dependencies = [+ "core-foundation 0.10.1",+ "core-graphics 0.24.0",+ "foreign-types",+ "libc",+]++[[package]]+name = "core_detect"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48"++[[package]]+name = "core_maths"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30"+dependencies = [+ "libm",+]++[[package]]+name = "cosmic-text"+version = "0.19.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "be17b688510d934ce13f48a2beba700e11583e281e0fda99c22bb256a14eda73"+dependencies = [+ "bitflags 2.13.2",+ "fontdb",+ "harfrust",+ "linebender_resource_handle",+ "log",+ "rangemap",+ "rustc-hash 2.1.3",+ "self_cell",+ "skrifa 0.40.0",+ "smol_str",+ "swash",+ "sys-locale",+ "unicode-bidi",+ "unicode-linebreak",+ "unicode-script",+ "unicode-segmentation",+]++[[package]]+name = "cpufeatures"+version = "0.2.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"+dependencies = [+ "libc",+]++[[package]]+name = "cpufeatures"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"+dependencies = [+ "libc",+]++[[package]]+name = "crc32fast"+version = "1.5.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5f97d3416d5337d15c4b0d78c8c91df922ca143f57ec20e2d1c188333047ef04"+dependencies = [+ "cfg-if",+]++[[package]]+name = "criterion"+version = "0.8.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3"+dependencies = [+ "alloca",+ "anes",+ "cast",+ "ciborium",+ "clap",+ "criterion-plot",+ "itertools 0.13.0",+ "num-traits",+ "oorandom",+ "page_size",+ "plotters",+ "rayon",+ "regex",+ "serde",+ "serde_json",+ "tinytemplate",+ "walkdir",+]++[[package]]+name = "criterion-plot"+version = "0.8.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea"+dependencies = [+ "cast",+ "itertools 0.13.0",+]++[[package]]+name = "crossbeam-deque"+version = "0.8.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"+dependencies = [+ "crossbeam-epoch",+ "crossbeam-utils",+]++[[package]]+name = "crossbeam-epoch"+version = "0.9.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"+dependencies = [+ "crossbeam-utils",+]++[[package]]+name = "crossbeam-queue"+version = "0.3.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "03e8bd762f7479489c70ed6c768ddca99d7296857de437a68dcb2a94365b3fae"+dependencies = [+ "crossbeam-utils",+]++[[package]]+name = "crossbeam-utils"+version = "0.8.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"++[[package]]+name = "crunchy"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"++[[package]]+name = "crypto-common"+version = "0.1.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"+dependencies = [+ "generic-array",+ "typenum",+]++[[package]]+name = "crypto-common"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"+dependencies = [+ "hybrid-array",+]++[[package]]+name = "ctor"+version = "1.0.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d"+dependencies = [+ "link-section",+ "linktime-proc-macro",+]++[[package]]+name = "data-url"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376"++[[package]]+name = "deranged"+version = "0.5.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e"++[[package]]+name = "derive_more"+version = "2.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134"+dependencies = [+ "derive_more-impl",+]++[[package]]+name = "derive_more-impl"+version = "2.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb"+dependencies = [+ "convert_case 0.10.0",+ "proc-macro2",+ "quote",+ "rustc_version",+ "syn 2.0.119",+]++[[package]]+name = "digest"+version = "0.10.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"+dependencies = [+ "block-buffer 0.10.4",+ "crypto-common 0.1.7",+ "subtle",+]++[[package]]+name = "digest"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"+dependencies = [+ "block-buffer 0.12.1",+ "const-oid",+ "crypto-common 0.2.2",+]++[[package]]+name = "dirs"+version = "5.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225"+dependencies = [+ "dirs-sys 0.4.1",+]++[[package]]+name = "dirs"+version = "6.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e"+dependencies = [+ "dirs-sys 0.5.0",+]++[[package]]+name = "dirs-sys"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c"+dependencies = [+ "libc",+ "option-ext",+ "redox_users 0.4.6",+ "windows-sys 0.48.0",+]++[[package]]+name = "dirs-sys"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"+dependencies = [+ "libc",+ "option-ext",+ "redox_users 0.5.3",+ "windows-sys 0.61.2",+]++[[package]]+name = "dispatch"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b"++[[package]]+name = "dispatch2"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "objc2 0.6.5",+]++[[package]]+name = "displaydoc"+version = "0.2.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "dlib"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a"+dependencies = [+ "libloading",+]++[[package]]+name = "document-features"+version = "0.2.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61"+dependencies = [+ "litrs",+]++[[package]]+name = "dunce"+version = "1.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"++[[package]]+name = "dwrote"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e1b35532432acc8b19ceed096e35dfa088d3ea037fe4f3c085f1f97f33b4d02"+dependencies = [+ "lazy_static",+ "libc",+ "winapi",+ "wio",+]++[[package]]+name = "dyn-clone"+version = "1.0.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"++[[package]]+name = "either"+version = "1.19.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"++[[package]]+name = "embed-resource"+version = "3.0.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6168487b5e7eb2673e6efe1200b1848016e436a6ca0b8031bf04bd9d493a249f"+dependencies = [+ "cc",+ "memchr",+ "rustc_version",+ "toml 1.2.0+spec-1.1.0",+ "vswhom",+ "winreg",+]++[[package]]+name = "encoding_rs"+version = "0.8.44"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5"+dependencies = [+ "cfg-if",+ "core_detect",+ "multiversion_no_op",+ "rustversion",+ "scopeguard",+ "simdutf8",+]++[[package]]+name = "encoding_rs_io"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fba3fe847045ecff794b9c138293a80db914678c453ad63fbf0c6a9eb6e00b22"+dependencies = [+ "encoding_rs",+]++[[package]]+name = "endi"+version = "1.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"++[[package]]+name = "enum-iterator"+version = "2.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a4549325971814bda7a44061bf3fe7e487d447cba01e4220a4b454d630d7a016"+dependencies = [+ "enum-iterator-derive",+]++[[package]]+name = "enum-iterator-derive"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "685adfa4d6f3d765a26bc5dbc936577de9abf756c1feeb3089b01dd395034842"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "enumflags2"+version = "0.7.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"+dependencies = [+ "enumflags2_derive",+ "serde",+]++[[package]]+name = "enumflags2_derive"+version = "0.7.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "enumn"+version = "0.1.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "equator"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc"+dependencies = [+ "equator-macro",+]++[[package]]+name = "equator-macro"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "equivalent"+version = "1.0.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"++[[package]]+name = "errno"+version = "0.3.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"+dependencies = [+ "libc",+ "windows-sys 0.61.2",+]++[[package]]+name = "etagere"+version = "0.2.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fc89bf99e5dc15954a60f707c1e09d7540e5cd9af85fa75caa0b510bc08c5342"+dependencies = [+ "euclid",+ "svg_fmt",+]++[[package]]+name = "euclid"+version = "0.22.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06"+dependencies = [+ "num-traits",+]++[[package]]+name = "event-listener"+version = "5.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"+dependencies = [+ "parking",+ "pin-project-lite",+]++[[package]]+name = "event-listener-strategy"+version = "0.5.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"+dependencies = [+ "event-listener",+ "pin-project-lite",+]++[[package]]+name = "exr"+version = "1.74.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "711fe42c9964295e01ee3fba3f9fe0e1d24b98886950d68efe81b1c76e21adf3"+dependencies = [+ "bit_field",+ "half",+ "lebe",+ "miniz_oxide 0.8.9",+ "num-complex",+ "pulp",+ "rayon-core",+ "smallvec",+ "zune-inflate",+]++[[package]]+name = "fastrand"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"++[[package]]+name = "fax"+version = "0.2.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a"++[[package]]+name = "fdeflate"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c"+dependencies = [+ "simd-adler32",+]++[[package]]+name = "find-msvc-tools"+version = "0.1.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48"++[[package]]+name = "fixedbitset"+version = "0.5.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99"++[[package]]+name = "flate2"+version = "1.1.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb"+dependencies = [+ "crc32fast",+ "miniz_oxide 0.9.1",+ "zlib-rs",+]++[[package]]+name = "float-cmp"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"++[[package]]+name = "float-ord"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8ce81f49ae8a0482e4c55ea62ebbd7e5a686af544c00b9d090bba3ff9be97b3d"++[[package]]+name = "float_next_after"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8"++[[package]]+name = "fluent-uri"+version = "0.1.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d"+dependencies = [+ "bitflags 1.3.2",+]++[[package]]+name = "flume"+version = "0.12.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5e139bc46ca777eb5efaf62df0ab8cc5fd400866427e56c68b22e414e53bd3be"+dependencies = [+ "futures-core",+ "futures-sink",+ "spin 0.9.9",+]++[[package]]+name = "fnv"+version = "1.0.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"++[[package]]+name = "foldhash"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"++[[package]]+name = "font-types"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5b38ad915f6dadd993ced50848a8291a543bd41ca62bc10740d5e64e2ab4cfd7"+dependencies = [+ "bytemuck",+]++[[package]]+name = "font-types"+version = "0.12.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "835ae9d781464a79026cde387f9cbc650c9a4909d7cf7e658b127e3c35d2f35d"+dependencies = [+ "bytemuck",+]++[[package]]+name = "fontconfig-parser"+version = "0.5.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbc773e24e02d4ddd8395fd30dc147524273a83e54e0f312d986ea30de5f5646"+dependencies = [+ "roxmltree 0.20.0",+]++[[package]]+name = "fontdb"+version = "0.23.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905"+dependencies = [+ "fontconfig-parser",+ "log",+ "memmap2",+ "slotmap",+ "tinyvec",+ "ttf-parser",+]++[[package]]+name = "foreign-types"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"+dependencies = [+ "foreign-types-macros",+ "foreign-types-shared",+]++[[package]]+name = "foreign-types-macros"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "foreign-types-shared"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"++[[package]]+name = "form_urlencoded"+version = "1.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"+dependencies = [+ "percent-encoding",+]++[[package]]+name = "freetype-sys"+version = "0.20.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0e7edc5b9669349acfda99533e9e0bcf26a51862ab43b08ee7745c55d28eb134"+dependencies = [+ "cc",+ "libc",+ "pkg-config",+]++[[package]]+name = "futf"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843"+dependencies = [+ "mac",+ "new_debug_unreachable",+]++[[package]]+name = "futures"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"+dependencies = [+ "futures-channel",+ "futures-core",+ "futures-executor",+ "futures-io",+ "futures-sink",+ "futures-task",+ "futures-util",+]++[[package]]+name = "futures-channel"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"+dependencies = [+ "futures-core",+ "futures-sink",+]++[[package]]+name = "futures-concurrency"+version = "7.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "175cd8cca9e1d45b87f18ffa75088f2099e3c4fe5e2f83e42de112560bea8ea6"+dependencies = [+ "fixedbitset",+ "futures-core",+ "futures-lite",+ "pin-project",+ "smallvec",+]++[[package]]+name = "futures-core"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"++[[package]]+name = "futures-executor"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"+dependencies = [+ "futures-core",+ "futures-task",+ "futures-util",+]++[[package]]+name = "futures-io"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"++[[package]]+name = "futures-lite"+version = "2.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"+dependencies = [+ "fastrand",+ "futures-core",+ "futures-io",+ "parking",+ "pin-project-lite",+]++[[package]]+name = "futures-macro"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "futures-sink"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"++[[package]]+name = "futures-task"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"++[[package]]+name = "futures-util"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"+dependencies = [+ "futures-channel",+ "futures-core",+ "futures-io",+ "futures-macro",+ "futures-sink",+ "futures-task",+ "memchr",+ "pin-project-lite",+ "slab",+]++[[package]]+name = "generic-array"+version = "0.14.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"+dependencies = [+ "typenum",+ "version_check",+]++[[package]]+name = "getrandom"+version = "0.2.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"+dependencies = [+ "cfg-if",+ "js-sys",+ "libc",+ "wasi",+ "wasm-bindgen",+]++[[package]]+name = "getrandom"+version = "0.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"+dependencies = [+ "cfg-if",+ "js-sys",+ "libc",+ "r-efi 5.3.0",+ "wasip2",+ "wasm-bindgen",+]++[[package]]+name = "getrandom"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"+dependencies = [+ "cfg-if",+ "js-sys",+ "libc",+ "r-efi 6.0.0",+ "rand_core 0.10.1",+ "wasm-bindgen",+]++[[package]]+name = "gif"+version = "0.13.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b"+dependencies = [+ "color_quant",+ "weezl",+]++[[package]]+name = "gif"+version = "0.14.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159"+dependencies = [+ "color_quant",+ "weezl",+]++[[package]]+name = "gimli"+version = "0.34.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1033caf0b349c518623b5396bfb2cf0bddf44f0306d543a250e5743297aafd10"++[[package]]+name = "gl_generator"+version = "0.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d"+dependencies = [+ "khronos_api",+ "log",+ "xml-rs",+]++[[package]]+name = "glob"+version = "0.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"++[[package]]+name = "globset"+version = "0.4.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f98b0d85522dc0a824cfebbc9594ff4a9b289c568bea0370319dfbdf20ccdd2d"+dependencies = [+ "aho-corasick",+ "bstr",+ "log",+ "regex-automata",+ "regex-syntax",+]++[[package]]+name = "globwalk"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc"+dependencies = [+ "bitflags 1.3.2",+ "ignore",+ "walkdir",+]++[[package]]+name = "glow"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29038e1c483364cc6bb3cf78feee1816002e127c331a1eec55a4d202b9e1adb5"+dependencies = [+ "js-sys",+ "slotmap",+ "wasm-bindgen",+ "web-sys",+]++[[package]]+name = "glutin_wgl_sys"+version = "0.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e"+dependencies = [+ "gl_generator",+]++[[package]]+name = "gpu-allocator"+version = "0.28.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795"+dependencies = [+ "ash",+ "hashbrown 0.16.1",+ "log",+ "presser",+ "thiserror 2.0.21",+ "windows 0.62.2",+]++[[package]]+name = "gpui-base"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cff6377e30f0c857681662e7edc7286bf30f5606033390401b0706d7bd930833"+dependencies = [+ "aho-corasick",+ "anyhow",+ "ashpd",+ "async-channel",+ "chrono",+ "data-url",+ "futures",+ "gpui-pre",+ "gpui-pre-macros",+ "gpui-pre-sum-tree",+ "html5ever",+ "instant",+ "itertools 0.13.0",+ "lsp-types",+ "markdown",+ "markup5ever_rcdom",+ "num-traits",+ "objc2 0.6.5",+ "objc2-app-kit 0.3.2",+ "objc2-foundation 0.3.2",+ "raw-window-handle",+ "regex",+ "ropey",+ "schemars",+ "serde",+ "serde_json",+ "smallvec",+ "smol",+ "tracing",+ "unicode-linebreak",+ "unicode-segmentation",+ "web-time",+ "windows 0.58.0",+]++[[package]]+name = "gpui-component"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "45bbfdba0efa392190f2fd446ec311325302eb047d5ce45dc1bcf189cb18f5eb"+dependencies = [+ "anyhow",+ "chrono",+ "core-text",+ "enum-iterator",+ "gpui-base",+ "gpui-component-macros",+ "gpui-kit-assets",+ "gpui-pre",+ "gpui-pre-macros",+ "gpui-pre-sum-tree",+ "instant",+ "itertools 0.13.0",+ "log",+ "lsp-types",+ "markdown",+ "notify",+ "num-traits",+ "objc2 0.6.5",+ "objc2-app-kit 0.3.2",+ "objc2-foundation 0.3.2",+ "once_cell",+ "paste",+ "raw-window-handle",+ "regex",+ "resvg 0.45.1",+ "ropey",+ "rust-i18n",+ "schemars",+ "serde",+ "serde_json",+ "serde_repr",+ "similar",+ "smallvec",+ "smol",+ "tracing",+ "unicode-segmentation",+ "unicode-width",+ "uuid",+ "windows 0.58.0",+]++[[package]]+name = "gpui-component-macros"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "21ac1d2ca5352973e291b3316c027e603b1e7334755341f44c8231f85fde627a"+dependencies = [+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "gpui-kit-assets"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "956a9864880e1f230e274a74cea8006e5018b8af383ad7bbd30b6b18254a97a9"+dependencies = [+ "anyhow",+ "gpui-pre",+ "gpui-pre-reqwest",+ "log",+ "rust-embed",+ "wasm-bindgen",+ "wasm-bindgen-futures",+]++[[package]]+name = "gpui-pre"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9303c771abf2acff2a96d706f69d9a82088c4770173a07cce88f0002431d887d"+dependencies = [+ "accesskit",+ "anyhow",+ "async-channel",+ "async-task",+ "backtrace",+ "bitflags 2.13.2",+ "chrono",+ "derive_more",+ "embed-resource",+ "etagere",+ "futures",+ "futures-concurrency",+ "getrandom 0.3.4",+ "gpui-pre-bench-metrics",+ "gpui-pre-collections",+ "gpui-pre-http-client",+ "gpui-pre-macros",+ "gpui-pre-refineable",+ "gpui-pre-scheduler",+ "gpui-pre-shared-string",+ "gpui-pre-sum-tree",+ "gpui-pre-util",+ "heapless",+ "icu_segmenter",+ "image",+ "inventory",+ "itertools 0.14.0",+ "libc",+ "log",+ "lyon",+ "num_cpus",+ "objc2-core-foundation",+ "objc2-core-video",+ "parking",+ "parking_lot",+ "pin-project",+ "pollster 0.4.0",+ "postage",+ "profiling",+ "proptest",+ "rand 0.9.5",+ "raw-window-handle",+ "regex",+ "resvg 0.46.0",+ "schemars",+ "seahash",+ "serde",+ "serde_json",+ "slotmap",+ "smallvec",+ "spin 0.10.1",+ "strum",+ "taffy",+ "thiserror 2.0.21",+ "ttf-parser",+ "unicode-segmentation",+ "url",+ "usvg 0.46.0",+ "uuid",+ "waker-fn",+ "web-time",+ "windows 0.62.2",+ "zed-scap",+]++[[package]]+name = "gpui-pre-apple"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8c0bea8ffa563d3a1ada533e148bb55be7fb873c178979e889a3d1204f8e1b91"+dependencies = [+ "anyhow",+ "async-task",+ "block2 0.6.2",+ "cbindgen",+ "core-foundation 0.10.1",+ "core-foundation-sys",+ "core-graphics 0.24.0",+ "core-text",+ "dispatch2",+ "etagere",+ "futures",+ "gpui-pre",+ "gpui-pre-collections",+ "gpui-pre-util",+ "image",+ "libc",+ "log",+ "mach2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-core-graphics",+ "objc2-core-text",+ "objc2-core-video",+ "objc2-foundation 0.3.2",+ "objc2-metal 0.3.2",+ "objc2-quartz-core 0.3.2",+ "objc2-security",+ "parking_lot",+ "pathfinder_geometry",+ "smallvec",+ "thiserror 2.0.21",+ "zed-font-kit",+]++[[package]]+name = "gpui-pre-bench-metrics"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a2380f9a4c76fbbf035fe0b83e7054216e0dbacb18e2a95bb26c27bda22376e3"+dependencies = [+ "anyhow",+ "criterion",+ "libc",+ "perf-event2",+]++[[package]]+name = "gpui-pre-collections"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "06882d54d40681ae3b145af9ef8a4021c2bf9967cc0a9fcf0cc50f003bf3cdf3"+dependencies = [+ "gpui-pre-util",+ "indexmap",+ "rustc-hash 2.1.3",+]++[[package]]+name = "gpui-pre-derive-refineable"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3999591b50cfd74f1734baf97fe802cce5f282d60d85b908e3393d534fbd50fb"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "gpui-pre-http-client"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a00ff0e68341f52c5903182d7e2e2d7dc247d87b0d9947ce3564e453720347a0"+dependencies = [+ "anyhow",+ "bytes",+ "futures",+ "http",+ "http-body",+ "log",+ "parking_lot",+ "serde",+ "serde_json",+ "serde_urlencoded",+ "url",+]++[[package]]+name = "gpui-pre-ios"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "326382c3b3f004617ac0f61338594c00f053b08b7875f3486ea0f221e9b20a75"+dependencies = [+ "anyhow",+ "block2 0.6.2",+ "futures",+ "gpui-pre",+ "gpui-pre-apple",+ "log",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-foundation 0.3.2",+ "objc2-quartz-core 0.3.2",+ "objc2-ui-kit",+ "parking_lot",+ "raw-window-handle",+ "uuid",+]++[[package]]+name = "gpui-pre-linux"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "79cac5cbd3485c1e3db8eafd5dc69019188f5cb0a39846946af772efa386f624"+dependencies = [+ "accesskit",+ "anyhow",+ "bytemuck",+ "calloop",+ "futures",+ "gpui-pre",+ "gpui-pre-collections",+ "gpui-pre-http-client",+ "gpui-pre-util",+ "libc",+ "log",+ "notify-rust",+ "oo7",+ "parking_lot",+ "raw-window-handle",+ "smallvec",+ "smol",+ "strum",+ "url",+ "uuid",+]++[[package]]+name = "gpui-pre-macos"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d7410cfdaa1fa55a414346cc492d18ce340e3a8b6d0ac3213b984ed690c82b92"+dependencies = [+ "accesskit",+ "accesskit_macos",+ "anyhow",+ "block2 0.6.2",+ "core-foundation 0.10.1",+ "core-foundation-sys",+ "core-graphics 0.24.0",+ "ctor",+ "dispatch2",+ "foreign-types",+ "futures",+ "gpui-pre",+ "gpui-pre-apple",+ "gpui-pre-collections",+ "gpui-pre-scheduler",+ "gpui-pre-util",+ "image",+ "itertools 0.14.0",+ "log",+ "objc2 0.6.5",+ "objc2-app-kit 0.3.2",+ "objc2-core-graphics",+ "objc2-core-video",+ "objc2-foundation 0.3.2",+ "objc2-quartz-core 0.3.2",+ "objc2-uniform-type-identifiers",+ "objc2-user-notifications",+ "parking_lot",+ "raw-window-handle",+ "semver",+ "smallvec",+ "strum",+ "uuid",+]++[[package]]+name = "gpui-pre-macros"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ee1c52959baa6834db3183e86affe70242ca90b4fc64ed2ae6dd689a799ce78e"+dependencies = [+ "heck 0.5.0",+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "gpui-pre-platform"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "175f55bd6a80ea3bb0cf44d9ba454a3312381d66e702b3b5e99f73a7ca1738ee"+dependencies = [+ "anyhow",+ "console_error_panic_hook",+ "gpui-pre",+ "gpui-pre-ios",+ "gpui-pre-linux",+ "gpui-pre-macos",+ "gpui-pre-web",+ "gpui-pre-windows",+]++[[package]]+name = "gpui-pre-refineable"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "097375d98fecafd6e00ec13c7711709cc6d827ccad385694ce9e2c2f570c02a5"+dependencies = [+ "gpui-pre-derive-refineable",+]++[[package]]+name = "gpui-pre-reqwest"+version = "0.12.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "05be23908e707966824f8c51a609904b7f30739e8d915e120a53c1b995ba964c"+dependencies = [+ "base64 0.22.1",+ "bytes",+ "encoding_rs",+ "futures-core",+ "futures-util",+ "h2",+ "http",+ "http-body",+ "http-body-util",+ "hyper",+ "hyper-rustls",+ "hyper-util",+ "ipnet",+ "js-sys",+ "log",+ "mime",+ "mime_guess",+ "once_cell",+ "percent-encoding",+ "pin-project-lite",+ "quinn",+ "rustls",+ "rustls-native-certs",+ "rustls-pemfile",+ "rustls-pki-types",+ "serde",+ "serde_json",+ "serde_urlencoded",+ "sync_wrapper",+ "system-configuration",+ "tokio",+ "tokio-rustls",+ "tokio-socks",+ "tokio-util",+ "tower",+ "tower-service",+ "url",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "wasm-streams",+ "web-sys",+ "windows-registry 0.4.0",+]++[[package]]+name = "gpui-pre-scheduler"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "93c3c9f76341cdf03801699d68876915b42d5858e80c52a141ebfc350358147b"+dependencies = [+ "async-task",+ "backtrace",+ "chrono",+ "flume",+ "futures",+ "parking_lot",+ "rand 0.9.5",+ "wasm_thread",+ "web-time",+]++[[package]]+name = "gpui-pre-shared-string"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "781aaf9a9c19e3367b94100c7b1a17283721766bc890909ce8aa34e8c5b1a99a"+dependencies = [+ "schemars",+ "serde",+ "smol_str",+]++[[package]]+name = "gpui-pre-sum-tree"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e0cb18765472fb2c64b7e6374f9a36f512ce25b1ccb3662fff51788564107eb3"+dependencies = [+ "gpui-pre-ztracing",+ "heapless",+ "rayon",+ "tracing",+]++[[package]]+name = "gpui-pre-util"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "49036ad9887034f8d6652b65761ee1c1fdbd7d66be33a6088245fae54dc643e3"+dependencies = [+ "anyhow",+ "log",+ "which",+]++[[package]]+name = "gpui-pre-web"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ad51fcf6e251d45b092fd4a98a26325eb9cf6ad4e6228b0c6bc50672db9e0563"+dependencies = [+ "anyhow",+ "async-channel",+ "console_error_panic_hook",+ "futures",+ "gpui-pre",+ "gpui-pre-http-client",+ "gpui-pre-scheduler",+ "gpui-pre-wgpu",+ "js-sys",+ "log",+ "parking_lot",+ "raw-window-handle",+ "smallvec",+ "unicode-properties",+ "unicode-script",+ "unicode-segmentation",+ "uuid",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "wasm_thread",+ "web-sys",+ "web-time",+]++[[package]]+name = "gpui-pre-wgpu"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "211cf352de1a0b0c9bea3f105df5572ce1d2c899389b924a888e5af36b50f93d"+dependencies = [+ "anyhow",+ "bytemuck",+ "cosmic-text",+ "etagere",+ "gpui-pre",+ "gpui-pre-collections",+ "gpui-pre-util",+ "itertools 0.14.0",+ "log",+ "parking_lot",+ "profiling",+ "raw-window-handle",+ "smallvec",+ "swash",+ "unicode-bidi",+ "unicode-segmentation",+ "web-sys",+ "wgpu",+]++[[package]]+name = "gpui-pre-windows"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5141a3db59bab761a16ab19529fe4117a86e91922e8fc00af6dfc4829cb1744d"+dependencies = [+ "accesskit",+ "accesskit_windows",+ "anyhow",+ "dunce",+ "etagere",+ "futures",+ "gpui-pre",+ "gpui-pre-collections",+ "gpui-pre-scheduler",+ "gpui-pre-util",+ "image",+ "itertools 0.14.0",+ "log",+ "parking_lot",+ "rand 0.9.5",+ "raw-window-handle",+ "smallvec",+ "uuid",+ "windows 0.62.2",+ "windows-core 0.62.2",+ "windows-numerics 0.3.1",+ "windows-registry 0.6.1",+]++[[package]]+name = "gpui-pre-ztracing"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7ac9274f4fb36ce6bf128f9b48032196a3120cb858503af33ced6c21366cf2f7"+dependencies = [+ "gpui-pre-ztracing-macro",+ "tracing",+]++[[package]]+name = "gpui-pre-ztracing-macro"+version = "0.3.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "99b18b06f5026b3d312488eacfdddbe78f82b4bf32bb2d2bc3186e31e552b797"++[[package]]+name = "granit-parser"+version = "1.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e20f99e46474f56bd905c56e817ebddcf377a611f94c53ac4649e4d3fa3c0cd0"+dependencies = [+ "arraydeque",+ "smallvec",+]++[[package]]+name = "h2"+version = "0.4.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7d29020232d6aa3fb1daca64c1127cf662cf97f254ae16c18c05b8ab635fc118"+dependencies = [+ "atomic-waker",+ "bytes",+ "fnv",+ "futures-core",+ "futures-sink",+ "http",+ "indexmap",+ "slab",+ "tokio",+ "tokio-util",+ "tracing",+]++[[package]]+name = "half"+version = "2.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"+dependencies = [+ "cfg-if",+ "crunchy",+ "num-traits",+ "zerocopy",+]++[[package]]+name = "harfrust"+version = "0.5.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9da2e5ae821f6e96664977bf974d6d6a2d6682f9ccee23e62ec1d134246845f9"+dependencies = [+ "bitflags 2.13.2",+ "bytemuck",+ "core_maths",+ "read-fonts 0.37.0",+ "smallvec",+]++[[package]]+name = "hash32"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"+dependencies = [+ "byteorder",+]++[[package]]+name = "hashbrown"+version = "0.16.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"+dependencies = [+ "allocator-api2",+ "equivalent",+ "foldhash",+]++[[package]]+name = "hashbrown"+version = "0.17.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"+dependencies = [+ "foldhash",+]++[[package]]+name = "heapless"+version = "0.9.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "25ba4bd83f9415b58b4ed8dc5714c76e626a105be4646c02630ad730ad3b5aa4"+dependencies = [+ "hash32",+ "stable_deref_trait",+]++[[package]]+name = "heck"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"++[[package]]+name = "heck"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"++[[package]]+name = "hermit-abi"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284"++[[package]]+name = "hex"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"++[[package]]+name = "hkdf"+version = "0.12.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"+dependencies = [+ "hmac",+]++[[package]]+name = "hmac"+version = "0.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"+dependencies = [+ "digest 0.10.7",+]++[[package]]+name = "html5ever"+version = "0.27.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4"+dependencies = [+ "log",+ "mac",+ "markup5ever",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "http"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0"+dependencies = [+ "bytes",+ "itoa",+]++[[package]]+name = "http-body"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c"+dependencies = [+ "bytes",+ "http",+]++[[package]]+name = "http-body-util"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c"+dependencies = [+ "bytes",+ "futures-core",+ "http",+ "http-body",+ "pin-project-lite",+]++[[package]]+name = "httparse"+version = "1.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"++[[package]]+name = "hybrid-array"+version = "0.4.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17"+dependencies = [+ "typenum",+]++[[package]]+name = "hyper"+version = "1.12.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2c3e324da4c95177d6291d4c8730197c0d1822f8a9766814a4a44fa5ab797c9c"+dependencies = [+ "atomic-waker",+ "bytes",+ "futures-channel",+ "futures-core",+ "h2",+ "http",+ "http-body",+ "httparse",+ "itoa",+ "pin-project-lite",+ "smallvec",+ "tokio",+ "want",+]++[[package]]+name = "hyper-rustls"+version = "0.27.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53"+dependencies = [+ "http",+ "hyper",+ "hyper-util",+ "rustls",+ "rustls-native-certs",+ "tokio",+ "tokio-rustls",+ "tower-service",+]++[[package]]+name = "hyper-util"+version = "0.1.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff"+dependencies = [+ "bytes",+ "futures-channel",+ "futures-util",+ "http",+ "http-body",+ "httparse",+ "hyper",+ "libc",+ "pin-project-lite",+ "socket2",+ "tokio",+ "tower-service",+ "tracing",+]++[[package]]+name = "iana-time-zone"+version = "0.1.65"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"+dependencies = [+ "android_system_properties",+ "core-foundation-sys",+ "iana-time-zone-haiku",+ "js-sys",+ "log",+ "wasm-bindgen",+ "windows-core 0.62.2",+]++[[package]]+name = "iana-time-zone-haiku"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"+dependencies = [+ "cc",+]++[[package]]+name = "icu_collections"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd"+dependencies = [+ "displaydoc",+ "potential_utf",+ "utf8_iter",+ "yoke",+ "zerofrom",+ "zerovec",+]++[[package]]+name = "icu_locale_core"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0"+dependencies = [+ "displaydoc",+ "litemap",+ "serde",+ "tinystr",+ "writeable",+ "zerovec",+]++[[package]]+name = "icu_locale_fallback"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "406e9ae5b95d8aa37db6293405931b766a6172d1848daee22d70eb44aa78a43c"+dependencies = [+ "icu_locale_core",+ "icu_locale_fallback_data",+ "icu_provider",+ "potential_utf",+ "tinystr",+ "zerovec",+]++[[package]]+name = "icu_locale_fallback_data"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3632ebbd0c5c3637ba1a40bdf8288f2cb9d2268e73441a69d5fc73d7cfbaa87c"++[[package]]+name = "icu_normalizer"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599"+dependencies = [+ "icu_collections",+ "icu_normalizer_data",+ "icu_properties",+ "icu_provider",+ "smallvec",+ "zerovec",+]++[[package]]+name = "icu_normalizer_data"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"++[[package]]+name = "icu_properties"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f"+dependencies = [+ "displaydoc",+ "icu_collections",+ "icu_locale_core",+ "icu_properties_data",+ "icu_provider",+ "zerotrie",+ "zerovec",+]++[[package]]+name = "icu_properties_data"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf"++[[package]]+name = "icu_provider"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514"+dependencies = [+ "displaydoc",+ "icu_locale_core",+ "serde",+ "stable_deref_trait",+ "writeable",+ "yoke",+ "zerofrom",+ "zerotrie",+ "zerovec",+]++[[package]]+name = "icu_segmenter"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "61b195dc605f81aa181bec9b3bd14e26cc71b903e4644f6af578ca9772c7a710"+dependencies = [+ "icu_collections",+ "icu_locale_fallback",+ "icu_provider",+ "icu_segmenter_data",+ "potential_utf",+ "smallvec",+ "utf8_iter",+ "zerotrie",+ "zerovec",+]++[[package]]+name = "icu_segmenter_data"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "913a7d294ad056474749152107309fdee3ec17d2482d1ab70fdc61a81c64b9a3"++[[package]]+name = "idna"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"+dependencies = [+ "idna_adapter",+ "smallvec",+ "utf8_iter",+]++[[package]]+name = "idna_adapter"+version = "1.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"+dependencies = [+ "icu_normalizer",+ "icu_properties",+]++[[package]]+name = "ignore"+version = "0.4.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "484be5657551d7868d67587df967fb4fcbe9d266a761cc855aaa148fda0b3cc7"+dependencies = [+ "crossbeam-deque",+ "globset",+ "log",+ "memchr",+ "regex-automata",+ "same-file",+ "walkdir",+ "winapi-util",+]++[[package]]+name = "image"+version = "0.25.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"+dependencies = [+ "bytemuck",+ "byteorder-lite",+ "color_quant",+ "exr",+ "gif 0.14.2",+ "image-webp",+ "moxcms",+ "num-traits",+ "png 0.18.1",+ "qoi",+ "ravif",+ "rayon",+ "tiff",+ "zune-core 0.5.3",+ "zune-jpeg 0.5.15",+]++[[package]]+name = "image-webp"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3"+dependencies = [+ "byteorder-lite",+ "quick-error 2.0.1",+]++[[package]]+name = "imagesize"+version = "0.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285"++[[package]]+name = "imagesize"+version = "0.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09e54e57b4c48b40f7aec75635392b12b3421fa26fe8b4332e63138ed278459c"++[[package]]+name = "imgref"+version = "1.12.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6e44b0a4eaa4c82f441d50a963f2d5f05a787240aeee097597033e72accfd22f"++[[package]]+name = "indexmap"+version = "2.14.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"+dependencies = [+ "equivalent",+ "hashbrown 0.17.1",+ "serde",+ "serde_core",+]++[[package]]+name = "inotify"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4cc00ea907cab49550b7da656f80ebb97be1b997d931fbcd28d39734e17ce592"+dependencies = [+ "bitflags 2.13.2",+ "inotify-sys",+ "libc",+]++[[package]]+name = "inotify-sys"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c033f80b2c113cdf91ab7a33faa9cbc014726dcad99880c8609af2a370edf37d"+dependencies = [+ "libc",+]++[[package]]+name = "inout"+version = "0.1.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"+dependencies = [+ "block-padding",+ "generic-array",+]++[[package]]+name = "instant"+version = "0.1.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"+dependencies = [+ "cfg-if",+ "js-sys",+ "wasm-bindgen",+ "web-sys",+]++[[package]]+name = "interpolate_name"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "inventory"+version = "0.3.25"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6928282826c822ad91bf1c9a1cb90a30ba1c26770749929b4656cd6be829cd7c"+dependencies = [+ "rustversion",+]++[[package]]+name = "ipnet"+version = "2.12.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0"++[[package]]+name = "itertools"+version = "0.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"+dependencies = [+ "either",+]++[[package]]+name = "itertools"+version = "0.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"+dependencies = [+ "either",+]++[[package]]+name = "itertools"+version = "0.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285"+dependencies = [+ "either",+]++[[package]]+name = "itoa"+version = "1.0.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"++[[package]]+name = "jni-sys"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258"+dependencies = [+ "jni-sys 0.4.1",+]++[[package]]+name = "jni-sys"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2"+dependencies = [+ "jni-sys-macros",+]++[[package]]+name = "jni-sys-macros"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264"+dependencies = [+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "jobserver"+version = "0.1.35"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"+dependencies = [+ "getrandom 0.4.3",+ "libc",+]++[[package]]+name = "js-sys"+version = "0.3.107"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a"+dependencies = [+ "cfg-if",+ "futures-util",+ "wasm-bindgen",+]++[[package]]+name = "khronos-egl"+version = "6.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76"+dependencies = [+ "libc",+ "libloading",+ "pkg-config",+]++[[package]]+name = "khronos_api"+version = "3.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"++[[package]]+name = "kqueue"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8d763e5b24120b4ddf50de6c92308156765aabfbbccebf401da7cff2d70a41ea"+dependencies = [+ "kqueue-sys",+ "libc",+]++[[package]]+name = "kqueue-sys"+version = "1.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087"+dependencies = [+ "bitflags 2.13.2",+ "libc",+]++[[package]]+name = "kurbo"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c62026ae44756f8a599ba21140f350303d4f08dcdcc71b5ad9c9bb8128c13c62"+dependencies = [+ "arrayvec",+ "euclid",+ "smallvec",+]++[[package]]+name = "kurbo"+version = "0.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4b60dfc32f652b926df6192e55525b16d186c69d47876c3ead4da5cc9f8450e2"+dependencies = [+ "arrayvec",+ "euclid",+ "polycool",+ "smallvec",+]++[[package]]+name = "lazy_static"+version = "1.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb"++[[package]]+name = "lebe"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8"++[[package]]+name = "libc"+version = "0.2.191"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"++[[package]]+name = "libfuzzer-sys"+version = "0.4.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2"+dependencies = [+ "arbitrary",+ "cc",+]++[[package]]+name = "libloading"+version = "0.8.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"+dependencies = [+ "cfg-if",+ "windows-link 0.2.1",+]++[[package]]+name = "libm"+version = "0.2.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"++[[package]]+name = "libredox"+version = "0.1.25"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d"+dependencies = [+ "libc",+]++[[package]]+name = "linebender_resource_handle"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"++[[package]]+name = "link-section"+version = "0.19.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "39c29a617ce3df32c08497bdc1ab6e2376e0b17948ac166a2fbe5977c5954cd9"++[[package]]+name = "linktime-proc-macro"+version = "0.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7e57c38c1e860fd37c604281cdfb1dd2216977fd76a50f85ba2f388ef3219616"++[[package]]+name = "linux-raw-sys"+version = "0.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"++[[package]]+name = "litemap"+version = "0.8.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"++[[package]]+name = "litrs"+version = "1.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4744e383959f0db86ede514b809b1c53251889093803c05267acc7d4e7030d70"++[[package]]+name = "lock_api"+version = "0.4.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"+dependencies = [+ "scopeguard",+]++[[package]]+name = "log"+version = "0.4.35"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c"+dependencies = [+ "serde_core",+]++[[package]]+name = "loop9"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062"+dependencies = [+ "imgref",+]++[[package]]+name = "lru-slab"+version = "0.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4050469837a6ff301cd14c1f8f24f88549e6d548f24f64e2148eb0f72cebc51f"++[[package]]+name = "lsp-types"+version = "0.97.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "53353550a17c04ac46c585feb189c2db82154fc84b79c7a66c96c2c644f66071"+dependencies = [+ "bitflags 1.3.2",+ "fluent-uri",+ "serde",+ "serde_json",+ "serde_repr",+]++[[package]]+name = "lyon"+version = "1.0.19"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bd0578bdecb7d6d88987b8b2b1e3a4e2f81df9d0ece1078623324a567904e7b7"+dependencies = [+ "lyon_algorithms",+ "lyon_tessellation",+]++[[package]]+name = "lyon_algorithms"+version = "1.0.22"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f3a6b9d4e8b48acd531fbf1241ad9b270df6e60b6b92bdea1469f4f40899d805"+dependencies = [+ "lyon_path",+ "num-traits",+]++[[package]]+name = "lyon_geom"+version = "1.0.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d82dd26aa4dc0b5b70b9115de59824842bcb43cf4a28e1b1e6d0ad148c93f93e"+dependencies = [+ "arrayvec",+ "euclid",+ "num-traits",+]++[[package]]+name = "lyon_path"+version = "1.0.19"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c463f9c428b7fc5ec885dcd39ce4aa61e29111d0e33483f6f98c74e89d8621e"+dependencies = [+ "lyon_geom",+ "num-traits",+]++[[package]]+name = "lyon_tessellation"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd4872650e70dc907dd4f7ebc449d7d657a0d2658e423b2e724970870bbbf75b"+dependencies = [+ "float_next_after",+ "lyon_path",+ "num-traits",+]++[[package]]+name = "mac"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"++[[package]]+name = "mac-notification-sys"+version = "0.6.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd604973958ddcc11b561193c0fb96ba146506ef2f231ef2e7c35fd2cbc9beca"+dependencies = [+ "cc",+ "log",+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+ "time",+ "uuid",+]++[[package]]+name = "mach2"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dae608c151f68243f2b000364e1f7b186d9c29845f7d2d85bd31b9ad77ad552b"++[[package]]+name = "malloc_buf"+version = "0.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"+dependencies = [+ "libc",+]++[[package]]+name = "markdown"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a5cab8f2cadc416a82d2e783a1946388b31654d391d1c7d92cc1f03e295b1deb"+dependencies = [+ "serde",+ "unicode-id",+]++[[package]]+name = "markup5ever"+version = "0.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45"+dependencies = [+ "log",+ "phf",+ "phf_codegen",+ "string_cache",+ "string_cache_codegen",+ "tendril",+]++[[package]]+name = "markup5ever_rcdom"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "edaa21ab3701bfee5099ade5f7e1f84553fd19228cf332f13cd6e964bf59be18"+dependencies = [+ "html5ever",+ "markup5ever",+ "tendril",+ "xml5ever",+]++[[package]]+name = "maybe-rayon"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519"+dependencies = [+ "cfg-if",+ "rayon",+]++[[package]]+name = "md-5"+version = "0.10.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"+dependencies = [+ "cfg-if",+ "digest 0.10.7",+]++[[package]]+name = "memchr"+version = "2.8.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"++[[package]]+name = "memmap2"+version = "0.9.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6b0ca1155a9ecc25aa12e8313a119f32edf0255fea2f44839c4ac0a12b2ac157"+dependencies = [+ "libc",+]++[[package]]+name = "memoffset"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"+dependencies = [+ "autocfg",+]++[[package]]+name = "mime"+version = "0.3.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"++[[package]]+name = "mime_guess"+version = "2.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"+dependencies = [+ "mime",+ "unicase",+]++[[package]]+name = "miniz_oxide"+version = "0.8.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"+dependencies = [+ "adler2",+ "simd-adler32",+]++[[package]]+name = "miniz_oxide"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c"+dependencies = [+ "adler2",+ "simd-adler32",+]++[[package]]+name = "mio"+version = "1.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee"+dependencies = [+ "libc",+ "log",+ "wasi",+ "windows-sys 0.61.2",+]++[[package]]+name = "moxcms"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"+dependencies = [+ "num-traits",+ "pxfm",+]++[[package]]+name = "multiversion_no_op"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d"++[[package]]+name = "naga"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a616d2fb8c89516ac2723a581f69d6c18576046bed761bd6b305e5618e6ae130"+dependencies = [+ "arrayvec",+ "bit-set 0.10.0",+ "bitflags 2.13.2",+ "cfg-if",+ "cfg_aliases",+ "codespan-reporting",+ "half",+ "hashbrown 0.17.1",+ "indexmap",+ "libm",+ "log",+ "naga-types",+ "num-traits",+ "once_cell",+ "rustc-hash 1.1.0",+ "spirv",+ "thiserror 2.0.21",+ "unicode-ident",+]++[[package]]+name = "naga-types"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "590afbf58a6f4f62873cd5cff4468061844bafa1cdf399cc954537c22d768d49"+dependencies = [+ "hashbrown 0.17.1",+ "indexmap",+ "rustc-hash 1.1.0",+ "thiserror 2.0.21",+]++[[package]]+name = "ndk-sys"+version = "0.6.0+11769913"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873"+dependencies = [+ "jni-sys 0.3.1",+]++[[package]]+name = "new_debug_unreachable"+version = "1.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"++[[package]]+name = "no_std_io2"+version = "0.9.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "418abd1b6d34fbf6cae440dc874771b0525a604428704c76e48b29a5e67b8003"+dependencies = [+ "memchr",+]++[[package]]+name = "nohash-hasher"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"++[[package]]+name = "nom"+version = "8.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405"+dependencies = [+ "memchr",+]++[[package]]+name = "noop_proc_macro"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8"++[[package]]+name = "normpath"+version = "1.5.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b11ce00d2594068e8a27c9146fdc5cf9f3ac38eb42c7cd34d05fea618873ac9f"+dependencies = [+ "windows-sys 0.61.2",+]++[[package]]+name = "notify"+version = "8.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "82f812702fbc75d35416d3f884e04925be7e9498f4eceea2e24ba34559284674"+dependencies = [+ "bitflags 2.13.2",+ "inotify",+ "kqueue",+ "libc",+ "log",+ "mio",+ "notify-types",+ "objc2-core-foundation",+ "objc2-core-services",+ "walkdir",+ "windows-sys 0.61.2",+]++[[package]]+name = "notify-rust"+version = "4.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "50ff2e74231b72c832d82982193b417f230945be6bdb5575b251d941d31adb00"+dependencies = [+ "futures-lite",+ "log",+ "mac-notification-sys",+ "serde",+ "tauri-winrt-notification",+ "zbus",+]++[[package]]+name = "notify-types"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0a437a9308232ce794b1e7fdf540d38ea37efc3c73492640c13b4c8568b8f108"+dependencies = [+ "bitflags 2.13.2",+]++[[package]]+name = "ntapi"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae"+dependencies = [+ "winapi",+]++[[package]]+name = "num"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"+dependencies = [+ "num-bigint",+ "num-complex",+ "num-integer",+ "num-iter",+ "num-rational",+ "num-traits",+]++[[package]]+name = "num-bigint"+version = "0.4.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367"+dependencies = [+ "num-integer",+ "num-traits",+]++[[package]]+name = "num-bigint-dig"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a7f9a86e097b0d187ad0e65667c2f58b9254671e86e7dbb78036b16692eae099"+dependencies = [+ "libm",+ "num-integer",+ "num-iter",+ "num-traits",+ "once_cell",+ "rand 0.9.5",+ "serde",+ "smallvec",+ "zeroize",+]++[[package]]+name = "num-complex"+version = "0.4.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"+dependencies = [+ "bytemuck",+ "num-traits",+]++[[package]]+name = "num-conv"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"++[[package]]+name = "num-derive"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "num-integer"+version = "0.1.47"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"+dependencies = [+ "num-traits",+]++[[package]]+name = "num-iter"+version = "0.1.46"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b"+dependencies = [+ "num-integer",+ "num-traits",+]++[[package]]+name = "num-rational"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"+dependencies = [+ "num-bigint",+ "num-integer",+ "num-traits",+]++[[package]]+name = "num-traits"+version = "0.2.19"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"+dependencies = [+ "autocfg",+ "libm",+]++[[package]]+name = "num_cpus"+version = "1.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b"+dependencies = [+ "hermit-abi",+ "libc",+]++[[package]]+name = "objc"+version = "0.2.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"+dependencies = [+ "malloc_buf",+ "objc_exception",+]++[[package]]+name = "objc-foundation"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"+dependencies = [+ "block",+ "objc",+ "objc_id",+]++[[package]]+name = "objc-sys"+version = "0.3.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310"++[[package]]+name = "objc2"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "19d5490aaf8f1d7cf7688dfa9b0ce07900e168852c45cd2c03f534dfd27cfd0b"+dependencies = [+ "objc-sys",+ "objc2-encode",+]++[[package]]+name = "objc2"+version = "0.6.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8"+dependencies = [+ "objc2-encode",+]++[[package]]+name = "objc2-app-kit"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.5.1",+ "libc",+ "objc2 0.5.3",+ "objc2-core-data 0.2.2",+ "objc2-core-image 0.2.2",+ "objc2-foundation 0.2.2",+ "objc2-quartz-core 0.2.2",+]++[[package]]+name = "objc2-app-kit"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "libc",+ "objc2 0.6.5",+ "objc2-cloud-kit",+ "objc2-core-data 0.3.2",+ "objc2-core-foundation",+ "objc2-core-graphics",+ "objc2-core-image 0.3.2",+ "objc2-core-text",+ "objc2-core-video",+ "objc2-foundation 0.3.2",+ "objc2-quartz-core 0.3.2",+ "objc2-uniform-type-identifiers",+]++[[package]]+name = "objc2-cloud-kit"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc2-core-data"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.5.1",+ "objc2 0.5.3",+ "objc2-foundation 0.2.2",+]++[[package]]+name = "objc2-core-data"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc2-core-foundation"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "dispatch2",+ "libc",+ "objc2 0.6.5",+]++[[package]]+name = "objc2-core-graphics"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807"+dependencies = [+ "bitflags 2.13.2",+ "dispatch2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-io-surface",+]++[[package]]+name = "objc2-core-image"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80"+dependencies = [+ "block2 0.5.1",+ "objc2 0.5.3",+ "objc2-foundation 0.2.2",+ "objc2-metal 0.2.2",+]++[[package]]+name = "objc2-core-image"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006"+dependencies = [+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc2-core-services"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "583300ad934cba24ff5292aee751ecc070f7ca6b39a574cc21b7b5e588e06a0b"+dependencies = [+ "libc",+ "objc2-core-foundation",+]++[[package]]+name = "objc2-core-text"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-core-graphics",+]++[[package]]+name = "objc2-core-video"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-core-graphics",+ "objc2-io-surface",+ "objc2-metal 0.3.2",+]++[[package]]+name = "objc2-encode"+version = "4.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"++[[package]]+name = "objc2-foundation"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.5.1",+ "libc",+ "objc2 0.5.3",+]++[[package]]+name = "objc2-foundation"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "libc",+ "objc2 0.6.5",+ "objc2-core-foundation",+]++[[package]]+name = "objc2-io-surface"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-core-foundation",+]++[[package]]+name = "objc2-metal"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.5.1",+ "objc2 0.5.3",+ "objc2-foundation 0.2.2",+]++[[package]]+name = "objc2-metal"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "dispatch2",+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc2-quartz-core"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.5.1",+ "objc2 0.5.3",+ "objc2-foundation 0.2.2",+ "objc2-metal 0.2.2",+]++[[package]]+name = "objc2-quartz-core"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f"+dependencies = [+ "bitflags 2.13.2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-core-graphics",+ "objc2-foundation 0.3.2",+ "objc2-metal 0.3.2",+]++[[package]]+name = "objc2-security"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a"+dependencies = [+ "objc2-core-foundation",+]++[[package]]+name = "objc2-ui-kit"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-foundation 0.3.2",+ "objc2-quartz-core 0.3.2",+]++[[package]]+name = "objc2-uniform-type-identifiers"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7902ac02859fc1f7045f8b598c63f1ae0cc7efeaa06a9bc9f3d9a3c955974fa4"+dependencies = [+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc2-user-notifications"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e"+dependencies = [+ "bitflags 2.13.2",+ "block2 0.6.2",+ "objc2 0.6.5",+ "objc2-foundation 0.3.2",+]++[[package]]+name = "objc_exception"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4"+dependencies = [+ "cc",+]++[[package]]+name = "objc_id"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b"+dependencies = [+ "objc",+]++[[package]]+name = "object"+version = "0.40.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dd229a0361b9d0d4396176e02d65897f487eebeab7caa6d443855ee152ca0b9c"+dependencies = [+ "memchr",+]++[[package]]+name = "once_cell"+version = "1.21.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"++[[package]]+name = "oo7"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "78f2bfed90f1618b4b48dcad9307f25e14ae894e2949642c87c351601d62cebd"+dependencies = [+ "aes",+ "ashpd",+ "async-fs",+ "async-io",+ "async-lock",+ "blocking",+ "cbc",+ "cipher",+ "digest 0.10.7",+ "endi",+ "futures-lite",+ "futures-util",+ "getrandom 0.4.3",+ "hkdf",+ "hmac",+ "md-5",+ "num",+ "num-bigint-dig",+ "pbkdf2",+ "serde",+ "serde_bytes",+ "sha2 0.10.9",+ "subtle",+ "zbus",+ "zbus_macros",+ "zeroize",+ "zvariant",+]++[[package]]+name = "oorandom"+version = "11.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"++[[package]]+name = "openssl-probe"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1"++[[package]]+name = "option-ext"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"++[[package]]+name = "ordered-float"+version = "5.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c860fd3227ca4ac3cc032e2cd20cba3f02ccdf4b610538f8ee6584d56bb62e96"+dependencies = [+ "num-traits",+]++[[package]]+name = "ordered-stream"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"+dependencies = [+ "futures-core",+ "pin-project-lite",+]++[[package]]+name = "page_size"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da"+dependencies = [+ "libc",+ "winapi",+]++[[package]]+name = "parking"+version = "2.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"++[[package]]+name = "parking_lot"+version = "0.12.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"+dependencies = [+ "lock_api",+ "parking_lot_core",+]++[[package]]+name = "parking_lot_core"+version = "0.9.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"+dependencies = [+ "cfg-if",+ "libc",+ "redox_syscall",+ "smallvec",+ "windows-link 0.2.1",+]++[[package]]+name = "paste"+version = "1.0.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"++[[package]]+name = "pastey"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec"++[[package]]+name = "pathfinder_geometry"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3"+dependencies = [+ "log",+ "pathfinder_simd",+]++[[package]]+name = "pathfinder_simd"+version = "0.5.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4500030c302e4af1d423f36f3b958d1aecb6c04184356ed5a833bf6b60435777"+dependencies = [+ "rustc_version",+]++[[package]]+name = "pbkdf2"+version = "0.12.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"+dependencies = [+ "digest 0.10.7",+ "hmac",+]++[[package]]+name = "percent-encoding"+version = "2.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"++[[package]]+name = "perf-event-data"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "575828d9d7d205188048eb1508560607a03d21eafdbba47b8cade1736c1c28e1"+dependencies = [+ "bitflags 2.13.2",+ "c-enum",+ "perf-event-open-sys2",+]++[[package]]+name = "perf-event-open-sys2"+version = "5.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d9c25955321465255e437600b54296983fab1feac2cd0c38958adeb26dbae49e"+dependencies = [+ "libc",+ "memoffset",+]++[[package]]+name = "perf-event2"+version = "0.7.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0939b8fad77dfaeb29ebbd35faaeaadbf833167f30975f1b8993bbba09ea0a0f"+dependencies = [+ "bitflags 2.13.2",+ "c-enum",+ "libc",+ "memmap2",+ "perf-event-data",+ "perf-event-open-sys2",+]++[[package]]+name = "phf"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"+dependencies = [+ "phf_shared",+]++[[package]]+name = "phf_codegen"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a"+dependencies = [+ "phf_generator",+ "phf_shared",+]++[[package]]+name = "phf_generator"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"+dependencies = [+ "phf_shared",+ "rand 0.8.8",+]++[[package]]+name = "phf_shared"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"+dependencies = [+ "siphasher",+]++[[package]]+name = "pico-args"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"++[[package]]+name = "pin-project"+version = "1.1.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924"+dependencies = [+ "pin-project-internal",+]++[[package]]+name = "pin-project-internal"+version = "1.1.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "pin-project-lite"+version = "0.2.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"++[[package]]+name = "piper"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"+dependencies = [+ "atomic-waker",+ "fastrand",+ "futures-io",+]++[[package]]+name = "pkg-config"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"++[[package]]+name = "plotters"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747"+dependencies = [+ "num-traits",+ "plotters-backend",+ "plotters-svg",+ "wasm-bindgen",+ "web-sys",+]++[[package]]+name = "plotters-backend"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a"++[[package]]+name = "plotters-svg"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670"+dependencies = [+ "plotters-backend",+]++[[package]]+name = "png"+version = "0.17.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526"+dependencies = [+ "bitflags 1.3.2",+ "crc32fast",+ "fdeflate",+ "flate2",+ "miniz_oxide 0.8.9",+]++[[package]]+name = "png"+version = "0.18.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"+dependencies = [+ "bitflags 2.13.2",+ "crc32fast",+ "fdeflate",+ "flate2",+ "miniz_oxide 0.8.9",+]++[[package]]+name = "polling"+version = "3.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"+dependencies = [+ "cfg-if",+ "concurrent-queue",+ "hermit-abi",+ "pin-project-lite",+ "rustix",+ "windows-sys 0.61.2",+]++[[package]]+name = "pollster"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7"++[[package]]+name = "pollster"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"++[[package]]+name = "polycool"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "50596ddc09eb5ad5f75cacd40209568e66df71baf86e1499a0e99c4cff12a5a6"+dependencies = [+ "arrayvec",+]++[[package]]+name = "portable-atomic"+version = "1.15.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"++[[package]]+name = "portable-atomic-util"+version = "0.2.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715"+dependencies = [+ "portable-atomic",+]++[[package]]+name = "postage"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "af3fb618632874fb76937c2361a7f22afd393c982a2165595407edc75b06d3c1"+dependencies = [+ "atomic",+ "crossbeam-queue",+ "parking_lot",+ "pin-project",+ "pollster 0.2.5",+ "static_assertions",+ "thiserror 1.0.69",+]++[[package]]+name = "potential_utf"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"+dependencies = [+ "serde_core",+ "writeable",+ "zerovec",+]++[[package]]+name = "powerfmt"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958"++[[package]]+name = "ppv-lite86"+version = "0.2.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"+dependencies = [+ "zerocopy",+]++[[package]]+name = "precomputed-hash"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"++[[package]]+name = "presser"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa"++[[package]]+name = "proc-macro-crate"+version = "3.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"+dependencies = [+ "toml_edit 0.25.18+spec-1.1.0",+]++[[package]]+name = "proc-macro2"+version = "1.0.107"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"+dependencies = [+ "unicode-ident",+]++[[package]]+name = "profiling"+version = "1.0.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5"+dependencies = [+ "profiling-procmacros",+]++[[package]]+name = "profiling-procmacros"+version = "1.0.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb"+dependencies = [+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "proptest"+version = "1.12.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b8530004ccb15eae51c7e40009fbe317f341f804db54dc033eec1c50be28cfa0"+dependencies = [+ "bit-set 0.11.1",+ "bit-vec 0.10.1",+ "bitflags 2.13.2",+ "chacha20",+ "core_detect",+ "num-traits",+ "proptest-macro",+ "rand 0.10.3",+ "rand_xorshift",+ "regex-syntax",+ "rusty-fork",+ "tempfile",+ "unarray",+]++[[package]]+name = "proptest-macro"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e99782ea31698c2206c6887c1220d2f594b291c26cb9ec5b6d7cf175320bc212"+dependencies = [+ "convert_case 0.11.0",+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "pulp"+version = "0.22.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "046aa45b989642ec2e4717c8e72d677b13edd831a4d3b6cf37d9a3e54912496a"+dependencies = [+ "bytemuck",+ "cfg-if",+ "libm",+ "num-complex",+ "paste",+ "pulp-wasm-simd-flag",+ "raw-cpuid",+ "reborrow",+ "version_check",+]++[[package]]+name = "pulp-wasm-simd-flag"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1d8f70e07b9c3962945a74e59ca1c511bba65b6419468acc217c457d93f3c740"++[[package]]+name = "pxfm"+version = "0.1.30"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"++[[package]]+name = "qoi"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001"+dependencies = [+ "bytemuck",+]++[[package]]+name = "quick-error"+version = "1.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"++[[package]]+name = "quick-error"+version = "2.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"++[[package]]+name = "quick-xml"+version = "0.41.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1"+dependencies = [+ "memchr",+]++[[package]]+name = "quinn"+version = "0.11.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4051e23e9185c255a7e33ef59cdbca87a22d359052eecd22fc6b901fb37d9d11"+dependencies = [+ "bytes",+ "cfg_aliases",+ "pin-project-lite",+ "quinn-proto",+ "quinn-udp",+ "rustc-hash 2.1.3",+ "rustls",+ "socket2",+ "thiserror 2.0.21",+ "tokio",+ "tracing",+ "web-time",+]++[[package]]+name = "quinn-proto"+version = "0.11.19"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0e750cca55fe4f0439a15d0bb529da9651e79993e8e72c61a899a36d462befbe"+dependencies = [+ "bytes",+ "getrandom 0.4.3",+ "lru-slab",+ "rand 0.10.3",+ "rand_pcg",+ "ring",+ "rustc-hash 2.1.3",+ "rustls",+ "rustls-pki-types",+ "slab",+ "thiserror 2.0.21",+ "tinyvec",+ "tracing",+ "web-time",+]++[[package]]+name = "quinn-udp"+version = "0.5.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "af66907df18639dcf4db56ca65490cabc4b27a97dbadd96f2926cca73298f016"+dependencies = [+ "cfg_aliases",+ "libc",+ "once_cell",+ "socket2",+ "tracing",+ "windows-sys 0.61.2",+]++[[package]]+name = "quote"+version = "1.0.47"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"+dependencies = [+ "proc-macro2",+]++[[package]]+name = "r-efi"+version = "5.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"++[[package]]+name = "r-efi"+version = "6.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"++[[package]]+name = "rand"+version = "0.8.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c"+dependencies = [+ "libc",+ "rand_chacha 0.3.1",+ "rand_core 0.6.4",+]++[[package]]+name = "rand"+version = "0.9.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"+dependencies = [+ "rand_chacha 0.9.0",+ "rand_core 0.9.5",+]++[[package]]+name = "rand"+version = "0.10.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af"+dependencies = [+ "chacha20",+ "getrandom 0.4.3",+ "rand_core 0.10.1",+]++[[package]]+name = "rand_chacha"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"+dependencies = [+ "ppv-lite86",+ "rand_core 0.6.4",+]++[[package]]+name = "rand_chacha"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"+dependencies = [+ "ppv-lite86",+ "rand_core 0.9.5",+]++[[package]]+name = "rand_core"+version = "0.6.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"+dependencies = [+ "getrandom 0.2.17",+]++[[package]]+name = "rand_core"+version = "0.9.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"+dependencies = [+ "getrandom 0.3.4",+]++[[package]]+name = "rand_core"+version = "0.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"++[[package]]+name = "rand_pcg"+version = "0.10.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a"+dependencies = [+ "rand_core 0.10.1",+]++[[package]]+name = "rand_xorshift"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "60aa6af80be32871323012e02e6e65f8a7cc7890931ae421d217ad8fe0df2ccf"+dependencies = [+ "rand_core 0.10.1",+]++[[package]]+name = "range-alloc"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08"++[[package]]+name = "rangemap"+version = "1.8.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a611d15b50743feb4c76b7d03edcb0e64f399c26961e4efe6975bc398be6aa3d"++[[package]]+name = "rav1e"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b"+dependencies = [+ "aligned-vec",+ "arbitrary",+ "arg_enum_proc_macro",+ "arrayvec",+ "av-scenechange",+ "av1-grain",+ "bitstream-io",+ "built",+ "cfg-if",+ "interpolate_name",+ "itertools 0.14.0",+ "libc",+ "libfuzzer-sys",+ "log",+ "maybe-rayon",+ "new_debug_unreachable",+ "noop_proc_macro",+ "num-derive",+ "num-traits",+ "paste",+ "profiling",+ "rand 0.9.5",+ "rand_chacha 0.9.0",+ "simd_helpers",+ "thiserror 2.0.21",+ "v_frame",+ "wasm-bindgen",+]++[[package]]+name = "ravif"+version = "0.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e52310197d971b0f5be7fe6b57530dcd27beb35c1b013f29d66c1ad73fbbcc45"+dependencies = [+ "avif-serialize",+ "imgref",+ "loop9",+ "quick-error 2.0.1",+ "rav1e",+ "rayon",+ "rgb",+]++[[package]]+name = "raw-cpuid"+version = "11.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186"+dependencies = [+ "bitflags 2.13.2",+]++[[package]]+name = "raw-window-handle"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539"++[[package]]+name = "raw-window-metal"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135"+dependencies = [+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-foundation 0.3.2",+ "objc2-quartz-core 0.3.2",+]++[[package]]+name = "rayon"+version = "1.12.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"+dependencies = [+ "either",+ "rayon-core",+]++[[package]]+name = "rayon-core"+version = "1.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"+dependencies = [+ "crossbeam-deque",+ "crossbeam-utils",+]++[[package]]+name = "read-fonts"+version = "0.37.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7b634fabf032fab15307ffd272149b622260f55974d9fad689292a5d33df02e5"+dependencies = [+ "bytemuck",+ "core_maths",+ "font-types 0.11.3",+]++[[package]]+name = "read-fonts"+version = "0.41.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "046a7d674daf459825b32f5062056d6882db0d2f5a479fbd76ccfc870ac18709"+dependencies = [+ "bytemuck",+ "font-types 0.12.7",+ "once_cell",+]++[[package]]+name = "reborrow"+version = "0.5.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430"++[[package]]+name = "redox_syscall"+version = "0.5.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"+dependencies = [+ "bitflags 2.13.2",+]++[[package]]+name = "redox_users"+version = "0.4.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"+dependencies = [+ "getrandom 0.2.17",+ "libredox",+ "thiserror 1.0.69",+]++[[package]]+name = "redox_users"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0"+dependencies = [+ "libredox",+ "thiserror 2.0.21",+]++[[package]]+name = "ref-cast"+version = "1.0.27"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3"+dependencies = [+ "ref-cast-impl",+]++[[package]]+name = "ref-cast-impl"+version = "1.0.27"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "regex"+version = "1.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"+dependencies = [+ "aho-corasick",+ "memchr",+ "regex-automata",+ "regex-syntax",+]++[[package]]+name = "regex-automata"+version = "0.4.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"+dependencies = [+ "aho-corasick",+ "memchr",+ "regex-syntax",+]++[[package]]+name = "regex-syntax"+version = "0.8.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"++[[package]]+name = "renderdoc-sys"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"++[[package]]+name = "resvg"+version = "0.45.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43"+dependencies = [+ "gif 0.13.3",+ "image-webp",+ "log",+ "pico-args",+ "rgb",+ "svgtypes 0.15.3",+ "tiny-skia",+ "usvg 0.45.1",+ "zune-jpeg 0.4.21",+]++[[package]]+name = "resvg"+version = "0.46.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b563218631706d614e23059436526d005b50ab5f2d506b55a17eb65c5eb83419"+dependencies = [+ "gif 0.14.2",+ "image-webp",+ "log",+ "pico-args",+ "rgb",+ "svgtypes 0.16.2",+ "tiny-skia",+ "usvg 0.46.0",+ "zune-jpeg 0.5.15",+]++[[package]]+name = "rgb"+version = "0.8.53"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4"+dependencies = [+ "bytemuck",+]++[[package]]+name = "ring"+version = "0.17.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"+dependencies = [+ "cc",+ "cfg-if",+ "getrandom 0.2.17",+ "libc",+ "untrusted",+ "windows-sys 0.52.0",+]++[[package]]+name = "ropey"+version = "2.0.0-beta.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4045a00dc327d084a2bbf126976e14125b54f23bd30511d45b842eba76c52d74"+dependencies = [+ "str_indices",+]++[[package]]+name = "roxmltree"+version = "0.20.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"++[[package]]+name = "roxmltree"+version = "0.21.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9da7f59328b09405b181fee1018925fad50f157afb43c0c0f5c522c256dd5907"+dependencies = [+ "memchr",+]++[[package]]+name = "rust-embed"+version = "8.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "19afa5b4b6a611de00bd1bdae6ae6f39084c9399f0679c3f52d8469cf335cc23"+dependencies = [+ "rust-embed-impl",+ "rust-embed-utils",+ "walkdir",+]++[[package]]+name = "rust-embed-impl"+version = "8.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e0d8afda6374eac59e066abee06d265247ebbaf3006cf878e2879e8356e34053"+dependencies = [+ "mime_guess",+ "proc-macro2",+ "quote",+ "rust-embed-utils",+ "shellexpand",+ "syn 2.0.119",+ "walkdir",+]++[[package]]+name = "rust-embed-utils"+version = "8.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d84e8ba78bd384263e5922f084cbe1b081c3b7e69add59c8fb097b879ba968a"+dependencies = [+ "globset",+ "sha2 0.11.1",+ "walkdir",+]++[[package]]+name = "rust-i18n"+version = "4.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8502e73e6461c738659455c5d2cf95bc132760a6f203c717e66ee72b78906d7f"+dependencies = [+ "globwalk",+ "regex",+ "rust-i18n-macro",+ "rust-i18n-support",+ "smallvec",+]++[[package]]+name = "rust-i18n-macro"+version = "4.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d54a28dd9d46108d56b9f0c85b220908844233e561c03087890325104f90f2c6"+dependencies = [+ "glob",+ "proc-macro2",+ "quote",+ "rust-i18n-support",+ "serde",+ "serde_json",+ "syn 2.0.119",+]++[[package]]+name = "rust-i18n-support"+version = "4.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e806c2a9701cbd6043992cd935c30cb1fdb128fa15e7b506f3b46f97045737c0"+dependencies = [+ "arc-swap",+ "base62",+ "foldhash",+ "globwalk",+ "itertools 0.11.0",+ "normpath",+ "serde",+ "serde-saphyr",+ "serde_json",+ "siphasher",+ "toml 0.8.23",+ "triomphe",+]++[[package]]+name = "rustc-demangle"+version = "0.1.28"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb"++[[package]]+name = "rustc-hash"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"++[[package]]+name = "rustc-hash"+version = "2.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"++[[package]]+name = "rustc_version"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"+dependencies = [+ "semver",+]++[[package]]+name = "rustix"+version = "1.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa"+dependencies = [+ "bitflags 2.13.2",+ "errno",+ "libc",+ "linux-raw-sys",+ "windows-sys 0.61.2",+]++[[package]]+name = "rustls"+version = "0.23.46"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"+dependencies = [+ "once_cell",+ "ring",+ "rustls-pki-types",+ "rustls-webpki",+ "subtle",+ "zeroize",+]++[[package]]+name = "rustls-native-certs"+version = "0.8.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4"+dependencies = [+ "openssl-probe",+ "rustls-pki-types",+ "schannel",+ "security-framework",+]++[[package]]+name = "rustls-pemfile"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50"+dependencies = [+ "rustls-pki-types",+]++[[package]]+name = "rustls-pki-types"+version = "1.15.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"+dependencies = [+ "web-time",+ "zeroize",+]++[[package]]+name = "rustls-webpki"+version = "0.103.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281"+dependencies = [+ "ring",+ "rustls-pki-types",+ "untrusted",+]++[[package]]+name = "rustversion"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"++[[package]]+name = "rusty-fork"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2"+dependencies = [+ "fnv",+ "quick-error 1.2.3",+ "tempfile",+ "wait-timeout",+]++[[package]]+name = "rustybuzz"+version = "0.20.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702"+dependencies = [+ "bitflags 2.13.2",+ "bytemuck",+ "core_maths",+ "log",+ "smallvec",+ "ttf-parser",+ "unicode-bidi-mirroring",+ "unicode-ccc",+ "unicode-properties",+ "unicode-script",+]++[[package]]+name = "ryu"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"++[[package]]+name = "same-file"+version = "1.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"+dependencies = [+ "winapi-util",+]++[[package]]+name = "schannel"+version = "0.1.30"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5"+dependencies = [+ "windows-sys 0.61.2",+]++[[package]]+name = "schemars"+version = "1.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e"+dependencies = [+ "dyn-clone",+ "indexmap",+ "ref-cast",+ "schemars_derive",+ "serde",+ "serde_json",+]++[[package]]+name = "schemars_derive"+version = "1.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e1c3a92094fa7d61aa124645844facb6b554dfc797136d0f5fd1f890e2bffc69"+dependencies = [+ "proc-macro2",+ "quote",+ "serde_derive_internals",+ "syn 3.0.9",+]++[[package]]+name = "scopeguard"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"++[[package]]+name = "screencapturekit"+version = "0.2.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1a5eeeb57ac94960cfe5ff4c402be6585ae4c8d29a2cf41b276048c2e849d64e"+dependencies = [+ "screencapturekit-sys",+]++[[package]]+name = "screencapturekit-sys"+version = "0.2.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "22411b57f7d49e7fe08025198813ee6fd65e1ee5eff4ebc7880c12c82bde4c60"+dependencies = [+ "block",+ "dispatch",+ "objc",+ "objc-foundation",+ "objc_id",+ "once_cell",+]++[[package]]+name = "seahash"+version = "4.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"++[[package]]+name = "security-framework"+version = "3.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"+dependencies = [+ "bitflags 2.13.2",+ "core-foundation 0.10.1",+ "core-foundation-sys",+ "libc",+ "security-framework-sys",+]++[[package]]+name = "security-framework-sys"+version = "2.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3"+dependencies = [+ "core-foundation-sys",+ "libc",+]++[[package]]+name = "self_cell"+version = "1.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2ab42ca02749e120097e328d91d415325bdf43b1c72c4c8badf37375fe40a813"++[[package]]+name = "semver"+version = "1.0.28"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"+dependencies = [+ "serde",+ "serde_core",+]++[[package]]+name = "serde"+version = "1.0.229"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"+dependencies = [+ "serde_core",+ "serde_derive",+]++[[package]]+name = "serde-saphyr"+version = "1.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b8050abb251097357e24aff63ba2c52a6309ecb7d23a5474023df960a02694d8"+dependencies = [+ "annotate-snippets",+ "base64 0.23.1",+ "encoding_rs_io",+ "granit-parser",+ "nohash-hasher",+ "num-traits",+ "serde_core",+ "smallvec",+ "zmij",+]++[[package]]+name = "serde_bytes"+version = "0.11.19"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8"+dependencies = [+ "serde",+ "serde_core",+]++[[package]]+name = "serde_core"+version = "1.0.229"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"+dependencies = [+ "serde_derive",+]++[[package]]+name = "serde_derive"+version = "1.0.229"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "serde_derive_internals"+version = "0.30.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "serde_json"+version = "1.0.154"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"+dependencies = [+ "foldhash",+ "indexmap",+ "itoa",+ "memchr",+ "serde",+ "serde_core",+ "zmij",+]++[[package]]+name = "serde_repr"+version = "0.1.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "serde_spanned"+version = "0.6.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"+dependencies = [+ "serde",+]++[[package]]+name = "serde_spanned"+version = "1.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c"+dependencies = [+ "serde_core",+]++[[package]]+name = "serde_urlencoded"+version = "0.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"+dependencies = [+ "form_urlencoded",+ "itoa",+ "ryu",+ "serde",+]++[[package]]+name = "sha1_smol"+version = "1.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d"++[[package]]+name = "sha2"+version = "0.10.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"+dependencies = [+ "cfg-if",+ "cpufeatures 0.2.17",+ "digest 0.10.7",+]++[[package]]+name = "sha2"+version = "0.11.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19"+dependencies = [+ "cfg-if",+ "cpufeatures 0.3.1",+ "digest 0.11.3",+]++[[package]]+name = "shellexpand"+version = "3.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8"+dependencies = [+ "dirs 6.0.0",+]++[[package]]+name = "shlex"+version = "2.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"++[[package]]+name = "signal-hook-registry"+version = "1.4.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"+dependencies = [+ "errno",+ "libc",+]++[[package]]+name = "simd-adler32"+version = "0.3.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"++[[package]]+name = "simd_helpers"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6"+dependencies = [+ "quote",+]++[[package]]+name = "simdutf8"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"++[[package]]+name = "similar"+version = "2.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa"+dependencies = [+ "bstr",+ "unicode-segmentation",+]++[[package]]+name = "simplecss"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c"+dependencies = [+ "log",+]++[[package]]+name = "siphasher"+version = "1.0.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256"++[[package]]+name = "skrifa"+version = "0.40.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7fbdfe3d2475fbd7ddd1f3e5cf8288a30eb3e5f95832829570cd88115a7434ac"+dependencies = [+ "bytemuck",+ "read-fonts 0.37.0",+]++[[package]]+name = "skrifa"+version = "0.44.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "819ab7d62b1d3e72d9d9dea5650bac30424f9111364bb94928dbf5ecad1baa68"+dependencies = [+ "bytemuck",+ "read-fonts 0.41.0",+]++[[package]]+name = "slab"+version = "0.4.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"++[[package]]+name = "slotmap"+version = "1.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038"+dependencies = [+ "version_check",+]++[[package]]+name = "smallvec"+version = "1.16.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8"++[[package]]+name = "smol"+version = "2.0.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a33bd3e260892199c3ccfc487c88b2da2265080acb316cd920da72fdfd7c599f"+dependencies = [+ "async-channel",+ "async-executor",+ "async-fs",+ "async-io",+ "async-lock",+ "async-net",+ "async-process",+ "blocking",+ "futures-lite",+]++[[package]]+name = "smol_str"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eeb7109d23f319619d4cc0de5464613c8b7b1a09db2774a58101459cf6be2f10"+dependencies = [+ "serde_core",+]++[[package]]+name = "socket2"+version = "0.6.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"+dependencies = [+ "libc",+ "windows-sys 0.61.2",+]++[[package]]+name = "spin"+version = "0.9.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e"+dependencies = [+ "lock_api",+]++[[package]]+name = "spin"+version = "0.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "023a211cb3138dbc438680b32560ad89f699977624c9f8dbb95a47d5b4c07dd3"+dependencies = [+ "lock_api",+]++[[package]]+name = "spirv"+version = "0.4.0+sdk-1.4.341.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d9571ea910ebd84c86af4b3ed27f9dbdc6ad06f17c5f96146b2b671e2976744f"+dependencies = [+ "bitflags 2.13.2",+]++[[package]]+name = "stable_deref_trait"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"++[[package]]+name = "static_assertions"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"++[[package]]+name = "str_indices"+version = "0.4.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d08889ec5408683408db66ad89e0e1f93dff55c73a4ccc71c427d5b277ee47e6"++[[package]]+name = "strict-num"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"+dependencies = [+ "float-cmp",+]++[[package]]+name = "string_cache"+version = "0.8.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f"+dependencies = [+ "new_debug_unreachable",+ "parking_lot",+ "phf_shared",+ "precomputed-hash",+ "serde",+]++[[package]]+name = "string_cache_codegen"+version = "0.5.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0"+dependencies = [+ "phf_generator",+ "phf_shared",+ "proc-macro2",+ "quote",+]++[[package]]+name = "strum"+version = "0.28.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd"+dependencies = [+ "strum_macros",+]++[[package]]+name = "strum_macros"+version = "0.28.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664"+dependencies = [+ "heck 0.5.0",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "subtle"+version = "2.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"++[[package]]+name = "svg_fmt"+version = "0.4.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb"++[[package]]+name = "svgtypes"+version = "0.15.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc"+dependencies = [+ "kurbo 0.11.3",+ "siphasher",+]++[[package]]+name = "svgtypes"+version = "0.16.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9f12b12995e3638c70618c1facb1ce65302f6a6f706b675f07c58a5d7391120e"+dependencies = [+ "kurbo 0.13.1",+ "siphasher",+]++[[package]]+name = "swash"+version = "0.2.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6c2499c2d826531388872b2268718aed907a39bd785ab0dcfe57fab26283f92e"+dependencies = [+ "skrifa 0.44.0",+ "yazi",+ "zeno",+]++[[package]]+name = "syn"+version = "2.0.119"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"+dependencies = [+ "proc-macro2",+ "quote",+ "unicode-ident",+]++[[package]]+name = "syn"+version = "3.0.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"+dependencies = [+ "proc-macro2",+ "quote",+ "unicode-ident",+]++[[package]]+name = "sync_wrapper"+version = "1.0.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"+dependencies = [+ "futures-core",+]++[[package]]+name = "synstructure"+version = "0.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "sys-locale"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4"+dependencies = [+ "libc",+]++[[package]]+name = "sysinfo"+version = "0.31.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be"+dependencies = [+ "core-foundation-sys",+ "libc",+ "memchr",+ "ntapi",+ "rayon",+ "windows 0.57.0",+]++[[package]]+name = "system-configuration"+version = "0.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"+dependencies = [+ "bitflags 2.13.2",+ "core-foundation 0.9.4",+ "system-configuration-sys",+]++[[package]]+name = "system-configuration-sys"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"+dependencies = [+ "core-foundation-sys",+ "libc",+]++[[package]]+name = "taffy"+version = "0.15.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "31f7bd2d97198df05186f93a3a3c306845f40e8b3c22bf9279cdd7e5cf5fea7d"+dependencies = [+ "serde",+ "slotmap",+ "smallvec",+]++[[package]]+name = "tao-core-video-sys"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "271450eb289cb4d8d0720c6ce70c72c8c858c93dd61fc625881616752e6b98f6"+dependencies = [+ "cfg-if",+ "core-foundation-sys",+ "libc",+ "objc",+]++[[package]]+name = "tauri-winrt-notification"+version = "0.7.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9ed071c670382e85fc2f48ae706492d8c338f4f89bf72520d32f8abfe880aade"+dependencies = [+ "thiserror 2.0.21",+ "windows 0.61.3",+ "windows-version",+]++[[package]]+name = "tempfile"+version = "3.27.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"+dependencies = [+ "fastrand",+ "getrandom 0.4.3",+ "once_cell",+ "rustix",+ "windows-sys 0.61.2",+]++[[package]]+name = "tendril"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0"+dependencies = [+ "futf",+ "mac",+ "utf-8",+]++[[package]]+name = "termcolor"+version = "1.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"+dependencies = [+ "winapi-util",+]++[[package]]+name = "thiserror"+version = "1.0.69"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"+dependencies = [+ "thiserror-impl 1.0.69",+]++[[package]]+name = "thiserror"+version = "2.0.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"+dependencies = [+ "thiserror-impl 2.0.21",+]++[[package]]+name = "thiserror-impl"+version = "1.0.69"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "thiserror-impl"+version = "2.0.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "tiff"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52"+dependencies = [+ "fax",+ "flate2",+ "half",+ "quick-error 2.0.1",+ "weezl",+ "zune-jpeg 0.5.15",+]++[[package]]+name = "time"+version = "0.3.55"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134"+dependencies = [+ "deranged",+ "num-conv",+ "powerfmt",+ "serde_core",+ "time-core",+]++[[package]]+name = "time-core"+version = "0.1.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"++[[package]]+name = "tiny-skia"+version = "0.11.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab"+dependencies = [+ "arrayref",+ "arrayvec",+ "bytemuck",+ "cfg-if",+ "log",+ "png 0.17.16",+ "tiny-skia-path",+]++[[package]]+name = "tiny-skia-path"+version = "0.11.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93"+dependencies = [+ "arrayref",+ "bytemuck",+ "strict-num",+]++[[package]]+name = "tinystr"+version = "0.8.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a"+dependencies = [+ "displaydoc",+ "serde_core",+ "zerovec",+]++[[package]]+name = "tinytemplate"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc"+dependencies = [+ "serde",+ "serde_json",+]++[[package]]+name = "tinyvec"+version = "1.13.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"++[[package]]+name = "tokio"+version = "1.54.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"+dependencies = [+ "bytes",+ "libc",+ "mio",+ "pin-project-lite",+ "socket2",+ "windows-sys 0.61.2",+]++[[package]]+name = "tokio-rustls"+version = "0.26.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db"+dependencies = [+ "rustls",+ "tokio",+]++[[package]]+name = "tokio-socks"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a7e2948f60dbe26b35f2c7fb74ac2854c1fddded0fe9d7548fcc674a246f7615"+dependencies = [+ "either",+ "futures-util",+ "thiserror 1.0.69",+ "tokio",+]++[[package]]+name = "tokio-util"+version = "0.7.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b"+dependencies = [+ "bytes",+ "futures-core",+ "futures-sink",+ "libc",+ "pin-project-lite",+ "tokio",+]++[[package]]+name = "toml"+version = "0.8.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"+dependencies = [+ "serde",+ "serde_spanned 0.6.9",+ "toml_datetime 0.6.11",+ "toml_edit 0.22.27",+]++[[package]]+name = "toml"+version = "1.2.0+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c5ffcdf8f50436dbbfd675c1fe1b8e0854f42b7defea8584bdebe1aee900e561"+dependencies = [+ "indexmap",+ "serde_core",+ "serde_spanned 1.1.2",+ "toml_datetime 1.1.2+spec-1.1.0",+ "toml_parser",+ "toml_writer",+ "winnow 1.0.5",+]++[[package]]+name = "toml_datetime"+version = "0.6.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"+dependencies = [+ "serde",+]++[[package]]+name = "toml_datetime"+version = "1.1.2+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053"+dependencies = [+ "serde_core",+]++[[package]]+name = "toml_edit"+version = "0.22.27"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"+dependencies = [+ "indexmap",+ "serde",+ "serde_spanned 0.6.9",+ "toml_datetime 0.6.11",+ "toml_write",+ "winnow 0.7.15",+]++[[package]]+name = "toml_edit"+version = "0.25.18+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1ec6e78bd70db9420d8d212fa9dc97f116448a1ceff5d00eabb991d407e21396"+dependencies = [+ "indexmap",+ "toml_datetime 1.1.2+spec-1.1.0",+ "toml_parser",+ "winnow 1.0.5",+]++[[package]]+name = "toml_parser"+version = "1.1.5+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c"+dependencies = [+ "winnow 1.0.5",+]++[[package]]+name = "toml_write"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"++[[package]]+name = "toml_writer"+version = "1.2.0+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "009dbb7700f11c55ef83aebbe4c0e9cf1f1ac0844bd8d6f00dc38f302026e13a"++[[package]]+name = "tower"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"+dependencies = [+ "futures-core",+ "futures-util",+ "pin-project-lite",+ "sync_wrapper",+ "tokio",+ "tower-layer",+ "tower-service",+]++[[package]]+name = "tower-layer"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"++[[package]]+name = "tower-service"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"++[[package]]+name = "tracing"+version = "0.1.44"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"+dependencies = [+ "log",+ "pin-project-lite",+ "tracing-attributes",+ "tracing-core",+]++[[package]]+name = "tracing-attributes"+version = "0.1.31"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "tracing-core"+version = "0.1.36"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"+dependencies = [+ "once_cell",+]++[[package]]+name = "triomphe"+version = "0.1.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d15f4f5898bcfc5d8a8e45ed30b2f108d710c1a2e5489dbf80e078f707181bc"+dependencies = [+ "arc-swap",+ "serde",+ "stable_deref_trait",+]++[[package]]+name = "try-lock"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"++[[package]]+name = "ttf-parser"+version = "0.25.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31"+dependencies = [+ "core_maths",+]++[[package]]+name = "typenum"+version = "1.20.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"++[[package]]+name = "uds_windows"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"+dependencies = [+ "memoffset",+ "tempfile",+ "windows-sys 0.61.2",+]++[[package]]+name = "unarray"+version = "0.1.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94"++[[package]]+name = "unicase"+version = "2.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f"++[[package]]+name = "unicode-bidi"+version = "0.3.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"++[[package]]+name = "unicode-bidi-mirroring"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5dfa6e8c60bb66d49db113e0125ee8711b7647b5579dc7f5f19c42357ed039fe"++[[package]]+name = "unicode-ccc"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e"++[[package]]+name = "unicode-id"+version = "0.3.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65dd75ab2d9d379dbe86d4059e91d8b5a6e7054865eaba1ddbfc7a817ff96392"++[[package]]+name = "unicode-ident"+version = "1.0.27"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"++[[package]]+name = "unicode-linebreak"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"++[[package]]+name = "unicode-properties"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "993ad287eb20e8ba755312801cfe1413e0f25d604075863acaddca10b04c1833"++[[package]]+name = "unicode-script"+version = "0.5.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aa04c955db05429d464c74d495c1ee677e1866e783a4c3747f9c0cef7756cabf"++[[package]]+name = "unicode-segmentation"+version = "1.13.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"++[[package]]+name = "unicode-vo"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94"++[[package]]+name = "unicode-width"+version = "0.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557"++[[package]]+name = "untrusted"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"++[[package]]+name = "url"+version = "2.5.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"+dependencies = [+ "form_urlencoded",+ "idna",+ "percent-encoding",+ "serde",+]++[[package]]+name = "usvg"+version = "0.45.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "80be9b06fbae3b8b303400ab20778c80bbaf338f563afe567cf3c9eea17b47ef"+dependencies = [+ "base64 0.22.1",+ "data-url",+ "flate2",+ "fontdb",+ "imagesize 0.13.0",+ "kurbo 0.11.3",+ "log",+ "pico-args",+ "roxmltree 0.20.0",+ "rustybuzz",+ "simplecss",+ "siphasher",+ "strict-num",+ "svgtypes 0.15.3",+ "tiny-skia-path",+ "unicode-bidi",+ "unicode-script",+ "unicode-vo",+ "xmlwriter",+]++[[package]]+name = "usvg"+version = "0.46.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e419dff010bb12512b0ae9e3d2f318dfbdf0167fde7eb05465134d4e8756076f"+dependencies = [+ "base64 0.22.1",+ "data-url",+ "flate2",+ "fontdb",+ "imagesize 0.14.0",+ "kurbo 0.13.1",+ "log",+ "pico-args",+ "roxmltree 0.21.2",+ "rustybuzz",+ "simplecss",+ "siphasher",+ "strict-num",+ "svgtypes 0.16.2",+ "tiny-skia-path",+ "unicode-bidi",+ "unicode-script",+ "unicode-vo",+ "xmlwriter",+]++[[package]]+name = "utf-8"+version = "0.7.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"++[[package]]+name = "utf8_iter"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0"+dependencies = [+ "utf_types",+]++[[package]]+name = "utf_types"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6"++[[package]]+name = "uuid"+version = "1.26.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce"+dependencies = [+ "getrandom 0.4.3",+ "js-sys",+ "serde_core",+ "sha1_smol",+ "wasm-bindgen",+]++[[package]]+name = "v_frame"+version = "0.3.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2"+dependencies = [+ "aligned-vec",+ "num-traits",+ "wasm-bindgen",+]++[[package]]+name = "version_check"+version = "0.9.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"++[[package]]+name = "vswhom"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b"+dependencies = [+ "libc",+ "vswhom-sys",+]++[[package]]+name = "vswhom-sys"+version = "0.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150"+dependencies = [+ "cc",+ "libc",+]++[[package]]+name = "wait-timeout"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11"+dependencies = [+ "libc",+]++[[package]]+name = "waker-fn"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7"++[[package]]+name = "walkdir"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"+dependencies = [+ "same-file",+ "winapi-util",+]++[[package]]+name = "want"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec4cdd0dd910afe868b7ef477227d8d538b46b3075031afee8a9f2acb0a2ed0b"+dependencies = [+ "try-lock",+]++[[package]]+name = "wasi"+version = "0.11.1+wasi-snapshot-preview1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"++[[package]]+name = "wasip2"+version = "1.0.4+wasi-0.2.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487"+dependencies = [+ "wit-bindgen",+]++[[package]]+name = "wasm-bindgen"+version = "0.2.130"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c"+dependencies = [+ "cfg-if",+ "rustversion",+ "wasm-bindgen-macro",+ "wasm-bindgen-shared",+]++[[package]]+name = "wasm-bindgen-futures"+version = "0.4.80"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5e14e0327cb5368ad60ccb22d04a9827a693c95a926d8d125e9fa39e0baec501"+dependencies = [+ "js-sys",+ "tokio",+ "wasm-bindgen",+]++[[package]]+name = "wasm-bindgen-macro"+version = "0.2.130"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9"+dependencies = [+ "quote",+ "wasm-bindgen-macro-support",+]++[[package]]+name = "wasm-bindgen-macro-support"+version = "0.2.130"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a"+dependencies = [+ "bumpalo",+ "proc-macro2",+ "quote",+ "syn 3.0.9",+ "wasm-bindgen-shared",+]++[[package]]+name = "wasm-bindgen-shared"+version = "0.2.130"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e"+dependencies = [+ "unicode-ident",+]++[[package]]+name = "wasm-streams"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65"+dependencies = [+ "futures-util",+ "js-sys",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "web-sys",+]++[[package]]+name = "wasm_thread"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b7516db7f32decdadb1c3b8deb1b7d78b9df7606c5cc2f6241737c2ab3a0258e"+dependencies = [+ "futures",+ "js-sys",+ "wasm-bindgen",+ "web-sys",+]++[[package]]+name = "wayland-sys"+version = "0.31.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d8eab23fefc9e41f8e841df4a9c707e8a8c4ed26e944ef69297184de2785e3be"+dependencies = [+ "dlib",+ "log",+ "once_cell",+ "pkg-config",+]++[[package]]+name = "web-sys"+version = "0.3.107"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d7d179596ff5ec0f6de4db64d54011bde6289cc49603d3a6e4ce3f329207ab88"+dependencies = [+ "js-sys",+ "wasm-bindgen",+]++[[package]]+name = "web-time"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"+dependencies = [+ "js-sys",+ "wasm-bindgen",+]++[[package]]+name = "weezl"+version = "0.1.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"++[[package]]+name = "wgpu"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "527ccdf43dd5b2e8676eed9984ce00e2bbb0a1b85b70c1969dcb6cd2eb55ab9e"+dependencies = [+ "arrayvec",+ "bitflags 2.13.2",+ "bytemuck",+ "cfg-if",+ "cfg_aliases",+ "document-features",+ "hashbrown 0.17.1",+ "js-sys",+ "log",+ "naga",+ "parking_lot",+ "portable-atomic",+ "profiling",+ "raw-window-handle",+ "smallvec",+ "static_assertions",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "web-sys",+ "wgpu-core",+ "wgpu-hal",+ "wgpu-types",+]++[[package]]+name = "wgpu-core"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "14c018fce9b6270aa203c2fdd56f3cce996713534bd757e4ea58c8560b121f14"+dependencies = [+ "arrayvec",+ "bit-set 0.10.0",+ "bit-vec 0.9.1",+ "bitflags 2.13.2",+ "bytemuck",+ "cfg_aliases",+ "document-features",+ "hashbrown 0.17.1",+ "indexmap",+ "log",+ "naga",+ "naga-types",+ "once_cell",+ "parking_lot",+ "portable-atomic",+ "profiling",+ "raw-window-handle",+ "rustc-hash 1.1.0",+ "smallvec",+ "thiserror 2.0.21",+ "wgpu-core-deps-apple",+ "wgpu-core-deps-emscripten",+ "wgpu-core-deps-wasm",+ "wgpu-core-deps-windows-linux-android",+ "wgpu-hal",+ "wgpu-naga-bridge",+ "wgpu-types",+]++[[package]]+name = "wgpu-core-deps-apple"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "061f3d319a40d39d00b1ecc2c33b89fe21d4e6fe01859df3500a3a8ecccd6b68"+dependencies = [+ "wgpu-hal",+]++[[package]]+name = "wgpu-core-deps-emscripten"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d98b86cf4abf524a902dd35f18ca6a3f08fc2ae9847c8f10b48e30491b1f0b86"+dependencies = [+ "wgpu-hal",+]++[[package]]+name = "wgpu-core-deps-wasm"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d260ca2ca8adc654f513a869bf3cac0b47f5b8d3f87803d6942015f8de597aae"+dependencies = [+ "wgpu-hal",+]++[[package]]+name = "wgpu-core-deps-windows-linux-android"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7586165fd5f6d881cb9ce4bb71f40d6caab2c0f1837e3fc1d9788a197fb6004f"+dependencies = [+ "wgpu-hal",+]++[[package]]+name = "wgpu-hal"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6b7fb58561a792bc237628ba0792e332de418fefe145f13b5ed8201e6d52f58"+dependencies = [+ "android_system_properties",+ "arrayvec",+ "ash",+ "bit-set 0.10.0",+ "bitflags 2.13.2",+ "block2 0.6.2",+ "bytemuck",+ "cfg-if",+ "cfg_aliases",+ "glow",+ "glutin_wgl_sys",+ "gpu-allocator",+ "hashbrown 0.17.1",+ "js-sys",+ "khronos-egl",+ "libc",+ "libloading",+ "log",+ "naga",+ "naga-types",+ "ndk-sys",+ "objc2 0.6.5",+ "objc2-core-foundation",+ "objc2-core-graphics",+ "objc2-foundation 0.3.2",+ "objc2-metal 0.3.2",+ "objc2-quartz-core 0.3.2",+ "once_cell",+ "ordered-float",+ "parking_lot",+ "portable-atomic",+ "portable-atomic-util",+ "profiling",+ "range-alloc",+ "raw-window-handle",+ "raw-window-metal",+ "renderdoc-sys",+ "smallvec",+ "static_assertions",+ "thiserror 2.0.21",+ "wasm-bindgen",+ "wayland-sys",+ "web-sys",+ "wgpu-naga-bridge",+ "wgpu-types",+ "windows 0.62.2",+ "windows-core 0.62.2",+ "windows-result 0.4.1",+]++[[package]]+name = "wgpu-naga-bridge"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d2f62e73117bb7a62bfd9c5a5841438a823f6566c6442a808ee269d2d055c081"+dependencies = [+ "naga",+ "wgpu-types",+]++[[package]]+name = "wgpu-types"+version = "30.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "99dad6f1fbdbbdb4c278a6508b059d44688f5cebddf78d005a46a31340269286"+dependencies = [+ "bitflags 2.13.2",+ "bytemuck",+ "js-sys",+ "log",+ "naga-types",+ "raw-window-handle",+ "static_assertions",+ "web-sys",+]++[[package]]+name = "which"+version = "8.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bae2f2b2b816647a1cab1acc91f5bd20812d53cb344382635ec2181940c8034f"+dependencies = [+ "libc",+]++[[package]]+name = "winapi"+version = "0.3.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"+dependencies = [+ "winapi-i686-pc-windows-gnu",+ "winapi-x86_64-pc-windows-gnu",+]++[[package]]+name = "winapi-i686-pc-windows-gnu"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"++[[package]]+name = "winapi-util"+version = "0.1.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"+dependencies = [+ "windows-sys 0.61.2",+]++[[package]]+name = "winapi-x86_64-pc-windows-gnu"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"++[[package]]+name = "windows"+version = "0.57.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143"+dependencies = [+ "windows-core 0.57.0",+ "windows-targets 0.52.6",+]++[[package]]+name = "windows"+version = "0.58.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6"+dependencies = [+ "windows-core 0.58.0",+ "windows-targets 0.52.6",+]++[[package]]+name = "windows"+version = "0.61.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"+dependencies = [+ "windows-collections 0.2.0",+ "windows-core 0.61.2",+ "windows-future 0.2.1",+ "windows-link 0.1.3",+ "windows-numerics 0.2.0",+]++[[package]]+name = "windows"+version = "0.62.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"+dependencies = [+ "windows-collections 0.3.2",+ "windows-core 0.62.2",+ "windows-future 0.3.2",+ "windows-numerics 0.3.1",+]++[[package]]+name = "windows-capture"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3a4df73e95feddb9ec1a7e9c2ca6323b8c97d5eeeff78d28f1eccdf19c882b24"+dependencies = [+ "parking_lot",+ "rayon",+ "thiserror 2.0.21",+ "windows 0.61.3",+ "windows-future 0.2.1",+]++[[package]]+name = "windows-collections"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"+dependencies = [+ "windows-core 0.61.2",+]++[[package]]+name = "windows-collections"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"+dependencies = [+ "windows-core 0.62.2",+]++[[package]]+name = "windows-core"+version = "0.57.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d"+dependencies = [+ "windows-implement 0.57.0",+ "windows-interface 0.57.0",+ "windows-result 0.1.2",+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-core"+version = "0.58.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99"+dependencies = [+ "windows-implement 0.58.0",+ "windows-interface 0.58.0",+ "windows-result 0.2.0",+ "windows-strings 0.1.0",+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-core"+version = "0.61.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"+dependencies = [+ "windows-implement 0.60.2",+ "windows-interface 0.59.3",+ "windows-link 0.1.3",+ "windows-result 0.3.4",+ "windows-strings 0.4.2",+]++[[package]]+name = "windows-core"+version = "0.62.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"+dependencies = [+ "windows-implement 0.60.2",+ "windows-interface 0.59.3",+ "windows-link 0.2.1",+ "windows-result 0.4.1",+ "windows-strings 0.5.1",+]++[[package]]+name = "windows-future"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"+dependencies = [+ "windows-core 0.61.2",+ "windows-link 0.1.3",+ "windows-threading 0.1.0",+]++[[package]]+name = "windows-future"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"+dependencies = [+ "windows-core 0.62.2",+ "windows-link 0.2.1",+ "windows-threading 0.2.1",+]++[[package]]+name = "windows-implement"+version = "0.57.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-implement"+version = "0.58.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-implement"+version = "0.60.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-interface"+version = "0.57.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-interface"+version = "0.58.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-interface"+version = "0.59.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "windows-link"+version = "0.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"++[[package]]+name = "windows-link"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"++[[package]]+name = "windows-numerics"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"+dependencies = [+ "windows-core 0.61.2",+ "windows-link 0.1.3",+]++[[package]]+name = "windows-numerics"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"+dependencies = [+ "windows-core 0.62.2",+ "windows-link 0.2.1",+]++[[package]]+name = "windows-registry"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3"+dependencies = [+ "windows-result 0.3.4",+ "windows-strings 0.3.1",+ "windows-targets 0.53.5",+]++[[package]]+name = "windows-registry"+version = "0.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"+dependencies = [+ "windows-link 0.2.1",+ "windows-result 0.4.1",+ "windows-strings 0.5.1",+]++[[package]]+name = "windows-result"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"+dependencies = [+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-result"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e"+dependencies = [+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-result"+version = "0.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"+dependencies = [+ "windows-link 0.1.3",+]++[[package]]+name = "windows-result"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"+dependencies = [+ "windows-link 0.2.1",+]++[[package]]+name = "windows-strings"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10"+dependencies = [+ "windows-result 0.2.0",+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-strings"+version = "0.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319"+dependencies = [+ "windows-link 0.1.3",+]++[[package]]+name = "windows-strings"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"+dependencies = [+ "windows-link 0.1.3",+]++[[package]]+name = "windows-strings"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"+dependencies = [+ "windows-link 0.2.1",+]++[[package]]+name = "windows-sys"+version = "0.48.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"+dependencies = [+ "windows-targets 0.48.5",+]++[[package]]+name = "windows-sys"+version = "0.52.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"+dependencies = [+ "windows-targets 0.52.6",+]++[[package]]+name = "windows-sys"+version = "0.61.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"+dependencies = [+ "windows-link 0.2.1",+]++[[package]]+name = "windows-targets"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"+dependencies = [+ "windows_aarch64_gnullvm 0.48.5",+ "windows_aarch64_msvc 0.48.5",+ "windows_i686_gnu 0.48.5",+ "windows_i686_msvc 0.48.5",+ "windows_x86_64_gnu 0.48.5",+ "windows_x86_64_gnullvm 0.48.5",+ "windows_x86_64_msvc 0.48.5",+]++[[package]]+name = "windows-targets"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"+dependencies = [+ "windows_aarch64_gnullvm 0.52.6",+ "windows_aarch64_msvc 0.52.6",+ "windows_i686_gnu 0.52.6",+ "windows_i686_gnullvm 0.52.6",+ "windows_i686_msvc 0.52.6",+ "windows_x86_64_gnu 0.52.6",+ "windows_x86_64_gnullvm 0.52.6",+ "windows_x86_64_msvc 0.52.6",+]++[[package]]+name = "windows-targets"+version = "0.53.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"+dependencies = [+ "windows-link 0.2.1",+ "windows_aarch64_gnullvm 0.53.1",+ "windows_aarch64_msvc 0.53.1",+ "windows_i686_gnu 0.53.1",+ "windows_i686_gnullvm 0.53.1",+ "windows_i686_msvc 0.53.1",+ "windows_x86_64_gnu 0.53.1",+ "windows_x86_64_gnullvm 0.53.1",+ "windows_x86_64_msvc 0.53.1",+]++[[package]]+name = "windows-threading"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"+dependencies = [+ "windows-link 0.1.3",+]++[[package]]+name = "windows-threading"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"+dependencies = [+ "windows-link 0.2.1",+]++[[package]]+name = "windows-version"+version = "0.1.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631"+dependencies = [+ "windows-link 0.2.1",+]++[[package]]+name = "windows_aarch64_gnullvm"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"++[[package]]+name = "windows_aarch64_gnullvm"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"++[[package]]+name = "windows_aarch64_gnullvm"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"++[[package]]+name = "windows_aarch64_msvc"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"++[[package]]+name = "windows_aarch64_msvc"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"++[[package]]+name = "windows_aarch64_msvc"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"++[[package]]+name = "windows_i686_gnu"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"++[[package]]+name = "windows_i686_gnu"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"++[[package]]+name = "windows_i686_gnu"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"++[[package]]+name = "windows_i686_gnullvm"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"++[[package]]+name = "windows_i686_gnullvm"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"++[[package]]+name = "windows_i686_msvc"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"++[[package]]+name = "windows_i686_msvc"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"++[[package]]+name = "windows_i686_msvc"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"++[[package]]+name = "windows_x86_64_gnu"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"++[[package]]+name = "windows_x86_64_gnu"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"++[[package]]+name = "windows_x86_64_gnu"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"++[[package]]+name = "windows_x86_64_gnullvm"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"++[[package]]+name = "windows_x86_64_gnullvm"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"++[[package]]+name = "windows_x86_64_gnullvm"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"++[[package]]+name = "windows_x86_64_msvc"+version = "0.48.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"++[[package]]+name = "windows_x86_64_msvc"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"++[[package]]+name = "windows_x86_64_msvc"+version = "0.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"++[[package]]+name = "winnow"+version = "0.7.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"+dependencies = [+ "memchr",+]++[[package]]+name = "winnow"+version = "1.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8c3b93199df0ab874cdf0c6a94f0a0dc3423fe41f1cafb62b8bd7b1deb277aef"+dependencies = [+ "memchr",+]++[[package]]+name = "winreg"+version = "0.56.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10"+dependencies = [+ "cfg-if",+ "windows-sys 0.61.2",+]++[[package]]+name = "wio"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5"+dependencies = [+ "winapi",+]++[[package]]+name = "wit-bindgen"+version = "0.57.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"++[[package]]+name = "writeable"+version = "0.6.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"++[[package]]+name = "x11"+version = "2.21.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e"+dependencies = [+ "libc",+ "pkg-config",+]++[[package]]+name = "xcb"+version = "1.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a6c2ad15e0e922856ee89afe862b8992334bbe7953adad56cd1199358cb30566"+dependencies = [+ "bitflags 2.13.2",+ "libc",+ "quick-xml",+ "x11",+]++[[package]]+name = "xml-rs"+version = "0.8.29"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7"++[[package]]+name = "xml5ever"+version = "0.18.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9bbb26405d8e919bc1547a5aa9abc95cbfa438f04844f5fdd9dc7596b748bf69"+dependencies = [+ "log",+ "mac",+ "markup5ever",+]++[[package]]+name = "xmlwriter"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"++[[package]]+name = "y4m"+version = "0.8.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448"++[[package]]+name = "yazi"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ac366ea532fa8ee6a992cec9dea525b1dc284e69702f36c2ab5fbebadc81ec86"++[[package]]+name = "yeslogic-fontconfig-sys"+version = "6.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1d8b8abf912b9a29ff112e1671c97c33636903d13a69712037190e6805af4f76"+dependencies = [+ "dlib",+ "once_cell",+ "pkg-config",+]++[[package]]+name = "yoke"+version = "0.8.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3"+dependencies = [+ "stable_deref_trait",+ "yoke-derive",+ "zerofrom",+]++[[package]]+name = "yoke-derive"+version = "0.8.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+ "synstructure",+]++[[package]]+name = "zbus"+version = "5.19.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907"+dependencies = [+ "async-broadcast",+ "async-executor",+ "async-io",+ "async-lock",+ "async-process",+ "async-recursion",+ "async-task",+ "async-trait",+ "blocking",+ "enumflags2",+ "event-listener",+ "futures-core",+ "futures-lite",+ "hex",+ "libc",+ "ordered-stream",+ "rustix",+ "serde",+ "serde_repr",+ "tracing",+ "uds_windows",+ "uuid",+ "windows-sys 0.61.2",+ "winnow 1.0.5",+ "zbus_macros",+ "zbus_names",+ "zvariant",+]++[[package]]+name = "zbus_macros"+version = "5.19.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40"+dependencies = [+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 3.0.9",+ "zbus_names",+ "zvariant",+ "zvariant_utils",+]++[[package]]+name = "zbus_names"+version = "4.3.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd"+dependencies = [+ "serde",+ "winnow 1.0.5",+ "zvariant",+]++[[package]]+name = "zcheapstr"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "939f186d9ecebe044315a5cb6d6f78568bbc21152adc954d5a0c2f58bdbc9920"+dependencies = [+ "serde",+]++[[package]]+name = "zed-font-kit"+version = "0.14.1-zed"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a3898e450f36f852edda72e3f985c34426042c4951790b23b107f93394f9bff5"+dependencies = [+ "bitflags 2.13.2",+ "byteorder",+ "core-foundation 0.10.1",+ "core-graphics 0.24.0",+ "core-text",+ "dirs 5.0.1",+ "dwrote",+ "float-ord",+ "freetype-sys",+ "lazy_static",+ "libc",+ "log",+ "pathfinder_geometry",+ "pathfinder_simd",+ "walkdir",+ "winapi",+ "yeslogic-fontconfig-sys",+]++[[package]]+name = "zed-scap"+version = "0.0.8-zed"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6b338d705ae33a43ca00287c11129303a7a0aa57b101b72a1c08c863f698ac8"+dependencies = [+ "anyhow",+ "cocoa",+ "core-graphics-helmer-fork",+ "log",+ "objc",+ "rand 0.8.8",+ "screencapturekit",+ "screencapturekit-sys",+ "sysinfo",+ "tao-core-video-sys",+ "windows 0.61.3",+ "windows-capture",+ "x11",+ "xcb",+]++[[package]]+name = "zeno"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524"++[[package]]+name = "zerocopy"+version = "0.8.63"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8"+dependencies = [+ "zerocopy-derive",+]++[[package]]+name = "zerocopy-derive"+version = "0.8.63"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "zerofrom"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"+dependencies = [+ "zerofrom-derive",+]++[[package]]+name = "zerofrom-derive"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+ "synstructure",+]++[[package]]+name = "zeroize"+version = "1.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879"+dependencies = [+ "zeroize_derive",+]++[[package]]+name = "zeroize_derive"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "zerotrie"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"+dependencies = [+ "displaydoc",+ "yoke",+ "zerofrom",+ "zerovec",+]++[[package]]+name = "zerovec"+version = "0.11.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40"+dependencies = [+ "serde",+ "yoke",+ "zerofrom",+ "zerovec-derive",+]++[[package]]+name = "zerovec-derive"+version = "0.11.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.9",+]++[[package]]+name = "zlib-rs"+version = "0.6.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112"++[[package]]+name = "zmij"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"++[[package]]+name = "zune-core"+version = "0.4.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a"++[[package]]+name = "zune-core"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b"++[[package]]+name = "zune-inflate"+version = "0.2.54"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02"+dependencies = [+ "simd-adler32",+]++[[package]]+name = "zune-jpeg"+version = "0.4.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713"+dependencies = [+ "zune-core 0.4.12",+]++[[package]]+name = "zune-jpeg"+version = "0.5.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"+dependencies = [+ "zune-core 0.5.3",+]++[[package]]+name = "zvariant"+version = "5.15.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7"+dependencies = [+ "endi",+ "enumflags2",+ "serde",+ "serde_bytes",+ "winnow 1.0.5",+ "zcheapstr",+ "zvariant_derive",+ "zvariant_utils",+]++[[package]]+name = "zvariant_derive"+version = "5.15.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d"+dependencies = [+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 3.0.9",+ "zvariant_utils",+]++[[package]]+name = "zvariant_utils"+version = "4.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3"+dependencies = [+ "proc-macro2",+ "quote",+ "serde",+ "syn 3.0.9",+ "winnow 1.0.5",+]diff --git a/bindings/rust/blenderui-vlist-gpui/Cargo.toml b/bindings/rust/blenderui-vlist-gpui/Cargo.tomlnew file mode 100644index 0000000..58187fd--- /dev/null+++ b/bindings/rust/blenderui-vlist-gpui/Cargo.toml@@ -0,0 +1,78 @@+[package]+name = "blenderui-vlist-gpui"+description = "A variable-height virtualized list (chat-grade) for gpui that paints only the visible items, on the shared blenderui-vlist core"+version = "0.2.0"+edition = "2024"+license = "GPL-2.0-or-later"+repository = "https://github.com/ppmpreetham/BUI"+homepage = "https://bui.preetham.top"+authors = ["BUI contributors"]+rust-version = "1.88"+documentation = "https://docs.rs/blenderui-vlist-gpui"+keywords = ["gpui", "list", "virtualization", "chat", "blender"]+categories = ["gui"]+readme = "README.md"+include = ["src/**", "examples/**", "README.md", "Cargo.toml"]+# not published; also kept out of the main workspace (gpui is a huge build)+publish = false++# its own workspace: like `blenderui-table-gpui`, it never enters the normal CI builds+[workspace]++[dependencies]+blenderui-vlist = { path = "../blenderui-vlist", version = "0.2.0" }+blenderui-paint-gpui = { path = "../blenderui-paint-gpui", version = "0.2.0" }+gpui = { package = "gpui-pre", version = "=0.3.11" }++[dev-dependencies]+gpui = { package = "gpui-pre", version = "=0.3.11", features = ["test-support"] }++[features]+# The head-to-head benchmark against gpui's `list` and gpui-component's `virtual_list` (a very large build).+bench = ["dep:gpui-component", "dep:gpui_platform", "dep:gpui-kit-assets"]++[dependencies.gpui-component]+version = "=0.9.0"+optional = true++[dependencies.gpui-kit-assets]+version = "=0.9.0"+optional = true++[dependencies.gpui_platform]+package = "gpui-pre-platform"+version = "=0.3.11"+optional = true++[[example]]+name = "bench_list_gpui"+path = "examples/bench_list_gpui.rs"+required-features = ["bench"]++[lints.clippy]+all = { level = "warn", priority = -2 }+pedantic = { level = "warn", priority = -2 }+perf = { level = "warn", priority = -1 }+complexity = { level = "warn", priority = -1 }+inline_always = "allow"+unseparated_literal_suffix = "allow"+similar_names = "allow"+missing_panics_doc = "allow"+missing_errors_doc = "allow"+absolute_paths = "allow"+module_name_repetitions = "allow"+doc_markdown = "allow"+too_many_lines = "allow"+unused_self = "allow"+cast_possible_truncation = "allow"+cast_sign_loss = "allow"+cast_precision_loss = "allow"+unreadable_literal = "allow"+implicit_hasher = "allow"+significant_drop_tightening = "warn"+redundant_clone = "warn"+use_self = "warn"+redundant_else = "warn"+or_fun_call = "warn"+missing_const_for_fn = "warn"+derive_partial_eq_without_eq = "warn"diff --git a/bindings/rust/blenderui-vlist-gpui/README.md b/bindings/rust/blenderui-vlist-gpui/README.mdnew file mode 100644index 0000000..1643873--- /dev/null+++ b/bindings/rust/blenderui-vlist-gpui/README.md@@ -0,0 +1,32 @@+# blenderui-vlist-gpui++A variable-height virtualized list (chat-grade) for [gpui](https://gpui.rs),+on the shared [`blenderui-vlist`](../blenderui-vlist) core: a height index+that is one block for 100 items and a Fenwick tree over blocks for 10M,+anchor-based scrolling, wrapped-text measuring with a per-frame budget, and+item sources (in memory, file-backed). It paints only the visible items,+straight into the window's scene, with one custom `Element`.++```rust+use blenderui_vlist_gpui::*;++let chat = cx.new(|cx| {+ ListState::new(+ ChatList::from_messages(messages, Palette::blender_dark(), 600.0, 400.0,+ Options { start_at_end: true, ..Options::default() }),+ cx,+ )+});+// in render+div().size_full().child(chat_list(&chat))+// from anywhere+chat.update(cx, |s, _| s.push(message)); // follows while at the bottom+```++Kept out of the main workspace (gpui is a huge build). To build it on+Windows, point `GPUI_FXC_PATH` at the SDK's `fxc.exe`:+`set GPUI_FXC_PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\fxc.exe`.++`cargo build --release --features bench --example bench_list_gpui -j 1` builds+the head-to-head against gpui's `list` (a `SumTree`) and gpui-component's+`virtual_list`; `node bench/run.mjs` runs it.diff --git a/bindings/rust/blenderui-vlist-gpui/bench/results.json b/bindings/rust/blenderui-vlist-gpui/bench/results.jsonnew file mode 100644index 0000000..babaadf--- /dev/null+++ b/bindings/rust/blenderui-vlist-gpui/bench/results.json@@ -0,0 +1,366 @@+[+ {+ "lib": "blenderui-vlist-gpui",+ "n": 100,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 0,+ "setup_ms": 0,+ "first_frame_ms": 507.6,+ "scroll_frames": 300,+ "fps": 60,+ "frame_ms_mean": 0.583,+ "frame_ms_p50": 0.541,+ "frame_ms_p95": 0.843,+ "frame_ms_p99": 0.922,+ "frame_ms_max": 1.003,+ "cpu_ms_per_frame": 3.425,+ "main_allocs_per_frame": 134,+ "still_frame_ms_p50": 0.55,+ "still_cpu_ms_per_frame": 3.415,+ "still_main_allocs_per_frame": 134.1,+ "jump_ms_p50": 0.532,+ "jump_ms_p95": 1.14,+ "jump_ms_max": 1.706,+ "ram_above_data_mb": 29.5,+ "peak_above_data_mb": 30.6,+ "private_mb": 34.2+ },+ {+ "lib": "blenderui-vlist-gpui",+ "n": 10000,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 5,+ "setup_ms": 0,+ "first_frame_ms": 500.7,+ "scroll_frames": 300,+ "fps": 60,+ "frame_ms_mean": 0.728,+ "frame_ms_p50": 0.689,+ "frame_ms_p95": 1.124,+ "frame_ms_p99": 1.464,+ "frame_ms_max": 3.045,+ "cpu_ms_per_frame": 3.101,+ "main_allocs_per_frame": 151.6,+ "still_frame_ms_p50": 0.417,+ "still_cpu_ms_per_frame": 2.158,+ "still_main_allocs_per_frame": 134.1,+ "jump_ms_p50": 1.405,+ "jump_ms_p95": 1.825,+ "jump_ms_max": 1.929,+ "ram_above_data_mb": 34.8,+ "peak_above_data_mb": 38.1,+ "private_mb": 44.1+ },+ {+ "lib": "blenderui-vlist-gpui",+ "n": 1000000,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 444,+ "setup_ms": 0.3,+ "first_frame_ms": 224.1,+ "scroll_frames": 301,+ "fps": 60,+ "frame_ms_mean": 0.755,+ "frame_ms_p50": 0.714,+ "frame_ms_p95": 1.158,+ "frame_ms_p99": 1.39,+ "frame_ms_max": 2.383,+ "cpu_ms_per_frame": 3.201,+ "main_allocs_per_frame": 152,+ "still_frame_ms_p50": 0.529,+ "still_cpu_ms_per_frame": 3.165,+ "still_main_allocs_per_frame": 134.1,+ "jump_ms_p50": 1.471,+ "jump_ms_p95": 1.911,+ "jump_ms_max": 2.34,+ "ram_above_data_mb": 31.9,+ "peak_above_data_mb": 45.8,+ "private_mb": 234+ },+ {+ "lib": "blenderui-vlist-gpui",+ "n": 10000000,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 1,+ "setup_ms": 81.5,+ "first_frame_ms": 591.2,+ "scroll_frames": 301,+ "fps": 60.1,+ "frame_ms_mean": 0.783,+ "frame_ms_p50": 0.739,+ "frame_ms_p95": 1.219,+ "frame_ms_p99": 1.441,+ "frame_ms_max": 2.864,+ "cpu_ms_per_frame": 3.315,+ "main_allocs_per_frame": 152.8,+ "still_frame_ms_p50": 0.456,+ "still_cpu_ms_per_frame": 2.462,+ "still_main_allocs_per_frame": 134.1,+ "jump_ms_p50": 1.536,+ "jump_ms_p95": 1.903,+ "jump_ms_max": 5.554,+ "ram_above_data_mb": 36.4,+ "peak_above_data_mb": 47.7,+ "private_mb": 49.7+ },+ {+ "lib": "gpui list (SumTree)",+ "n": 100,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 0,+ "setup_ms": 0,+ "first_frame_ms": 514.6,+ "scroll_frames": 301,+ "fps": 60,+ "frame_ms_mean": 1.04,+ "frame_ms_p50": 1.002,+ "frame_ms_p95": 1.392,+ "frame_ms_p99": 1.468,+ "frame_ms_max": 1.66,+ "cpu_ms_per_frame": 3.878,+ "main_allocs_per_frame": 793,+ "still_frame_ms_p50": 0.977,+ "still_cpu_ms_per_frame": 3.857,+ "still_main_allocs_per_frame": 793.1,+ "jump_ms_p50": 1.831,+ "jump_ms_p95": 2.433,+ "jump_ms_max": 2.961,+ "ram_above_data_mb": 29.6,+ "peak_above_data_mb": 31,+ "private_mb": 33.3+ },+ {+ "lib": "gpui list (SumTree)",+ "n": 10000,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 4,+ "setup_ms": 0.6,+ "first_frame_ms": 506.2,+ "scroll_frames": 300,+ "fps": 60,+ "frame_ms_mean": 1.31,+ "frame_ms_p50": 1.302,+ "frame_ms_p95": 1.704,+ "frame_ms_p99": 1.865,+ "frame_ms_max": 2.18,+ "cpu_ms_per_frame": 3.748,+ "main_allocs_per_frame": 938.9,+ "still_frame_ms_p50": 0.908,+ "still_cpu_ms_per_frame": 2.665,+ "still_main_allocs_per_frame": 810.1,+ "jump_ms_p50": 2.598,+ "jump_ms_p95": 2.981,+ "jump_ms_max": 3.084,+ "ram_above_data_mb": 31.2,+ "peak_above_data_mb": 32.3,+ "private_mb": 36.6+ },+ {+ "lib": "gpui list (SumTree)",+ "n": 1000000,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 434,+ "setup_ms": 57.8,+ "first_frame_ms": 370.9,+ "scroll_frames": 301,+ "fps": 60.1,+ "frame_ms_mean": 1.346,+ "frame_ms_p50": 1.32,+ "frame_ms_p95": 1.78,+ "frame_ms_p99": 1.893,+ "frame_ms_max": 2.373,+ "cpu_ms_per_frame": 3.825,+ "main_allocs_per_frame": 981.8,+ "still_frame_ms_p50": 1.047,+ "still_cpu_ms_per_frame": 3.418,+ "still_main_allocs_per_frame": 972.1,+ "jump_ms_p50": 2.576,+ "jump_ms_p95": 3.127,+ "jump_ms_max": 3.259,+ "ram_above_data_mb": 115.9,+ "peak_above_data_mb": 203.4,+ "private_mb": 318.1+ },+ {+ "lib": "gpui list (SumTree)",+ "n": 10000000,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 0,+ "setup_ms": 537.1,+ "first_frame_ms": 1995.2,+ "scroll_frames": 301,+ "fps": 60.1,+ "frame_ms_mean": 1.441,+ "frame_ms_p50": 1.438,+ "frame_ms_p95": 1.867,+ "frame_ms_p99": 2.031,+ "frame_ms_max": 2.26,+ "cpu_ms_per_frame": 4.023,+ "main_allocs_per_frame": 956.6,+ "still_frame_ms_p50": 1.171,+ "still_cpu_ms_per_frame": 3.307,+ "still_main_allocs_per_frame": 1019.1,+ "jump_ms_p50": 2.824,+ "jump_ms_p95": 3.44,+ "jump_ms_max": 3.584,+ "ram_above_data_mb": 940.4,+ "peak_above_data_mb": 1838.2,+ "private_mb": 948.8+ },+ {+ "lib": "gpui-component virtual_list",+ "n": 100,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 0,+ "setup_ms": 0.1,+ "first_frame_ms": 495.5,+ "scroll_frames": 300,+ "fps": 59.9,+ "frame_ms_mean": 1.08,+ "frame_ms_p50": 1.039,+ "frame_ms_p95": 1.455,+ "frame_ms_p99": 1.561,+ "frame_ms_max": 1.707,+ "cpu_ms_per_frame": 3.872,+ "main_allocs_per_frame": 923,+ "still_frame_ms_p50": 1.008,+ "still_cpu_ms_per_frame": 3.906,+ "still_main_allocs_per_frame": 923.1,+ "jump_ms_p50": 1.941,+ "jump_ms_p95": 2.495,+ "jump_ms_max": 2.591,+ "ram_above_data_mb": 27.9,+ "peak_above_data_mb": 28.7,+ "private_mb": 33.4+ },+ {+ "lib": "gpui-component virtual_list",+ "n": 10000,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 5,+ "setup_ms": 8.4,+ "first_frame_ms": 507.1,+ "scroll_frames": 300,+ "fps": 60,+ "frame_ms_mean": 1.266,+ "frame_ms_p50": 1.258,+ "frame_ms_p95": 1.718,+ "frame_ms_p99": 1.855,+ "frame_ms_max": 1.972,+ "cpu_ms_per_frame": 3.691,+ "main_allocs_per_frame": 1034.5,+ "still_frame_ms_p50": 1.124,+ "still_cpu_ms_per_frame": 3.932,+ "still_main_allocs_per_frame": 1078.1,+ "jump_ms_p50": 2.103,+ "jump_ms_p95": 2.599,+ "jump_ms_max": 2.79,+ "ram_above_data_mb": 28.9,+ "peak_above_data_mb": 29.2,+ "private_mb": 36+ },+ {+ "lib": "gpui-component virtual_list",+ "n": 1000000,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 437,+ "setup_ms": 627.5,+ "first_frame_ms": 835.8,+ "scroll_frames": 301,+ "fps": 60.1,+ "frame_ms_mean": 1.308,+ "frame_ms_p50": 1.297,+ "frame_ms_p95": 1.763,+ "frame_ms_p99": 1.91,+ "frame_ms_max": 2.163,+ "cpu_ms_per_frame": 3.697,+ "main_allocs_per_frame": 1091.3,+ "still_frame_ms_p50": 1.194,+ "still_cpu_ms_per_frame": 3.565,+ "still_main_allocs_per_frame": 1172.1,+ "jump_ms_p50": 2.149,+ "jump_ms_p95": 2.654,+ "jump_ms_max": 3.16,+ "ram_above_data_mb": 39.6,+ "peak_above_data_mb": 45.8,+ "private_mb": 242.5+ },+ {+ "lib": "gpui-component virtual_list",+ "n": 10000000,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 0,+ "setup_ms": 7284.7,+ "first_frame_ms": 7842.6,+ "scroll_frames": 301,+ "fps": 60,+ "frame_ms_mean": 1.327,+ "frame_ms_p50": 1.298,+ "frame_ms_p95": 1.824,+ "frame_ms_p99": 2.166,+ "frame_ms_max": 2.291,+ "cpu_ms_per_frame": 3.751,+ "main_allocs_per_frame": 983.8,+ "still_frame_ms_p50": 1.272,+ "still_cpu_ms_per_frame": 3.214,+ "still_main_allocs_per_frame": 1162.1,+ "jump_ms_p50": 2.234,+ "jump_ms_p95": 2.708,+ "jump_ms_max": 2.889,+ "ram_above_data_mb": 181.2,+ "peak_above_data_mb": 181.6,+ "private_mb": 186.8+ },+ {+ "lib": "blank (no list)",+ "n": 1000000,+ "finished": 3,+ "failed": 0,+ "failures": [],+ "data_ms": 466,+ "setup_ms": 0,+ "first_frame_ms": 257.2,+ "scroll_frames": 301,+ "fps": 60.1,+ "frame_ms_mean": 0.133,+ "frame_ms_p50": 0.128,+ "frame_ms_p95": 0.204,+ "frame_ms_p99": 0.277,+ "frame_ms_max": 0.303,+ "cpu_ms_per_frame": 0.85,+ "main_allocs_per_frame": 102.3,+ "still_frame_ms_p50": 0.13,+ "still_cpu_ms_per_frame": 0.885,+ "still_main_allocs_per_frame": 102.4,+ "jump_ms_p50": 0.127,+ "jump_ms_p95": 0.19,+ "jump_ms_max": 0.232,+ "ram_above_data_mb": -168.9,+ "peak_above_data_mb": 45.8,+ "private_mb": 27.9+ }+]\ No newline at end of filediff --git a/bindings/rust/blenderui-vlist-gpui/bench/results.md b/bindings/rust/blenderui-vlist-gpui/bench/results.mdnew file mode 100644index 0000000..cff352b--- /dev/null+++ b/bindings/rust/blenderui-vlist-gpui/bench/results.md@@ -0,0 +1,15 @@+| Library | Items | Finished | Setup ms | First frame ms | Scroll p50 ms | p95 | p99 | CPU ms/frame | Allocs/frame | Repaint p50 ms | Jump p50 ms | RAM above data MB | Peak MB |+|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|+| blenderui-vlist-gpui | 100 | 3/3 | 0.00 | 507.60 | 0.54 | 0.84 | 0.92 | 3.42 | 134 | 0.55 | 0.53 | 30 | 31 |+| blenderui-vlist-gpui | 10,000 | 3/3 | 0.00 | 500.70 | 0.69 | 1.12 | 1.46 | 3.10 | 152 | 0.42 | 1.41 | 35 | 38 |+| blenderui-vlist-gpui | 1,000,000 | 3/3 | 0.30 | 224.10 | 0.71 | 1.16 | 1.39 | 3.20 | 152 | 0.53 | 1.47 | 32 | 46 |+| blenderui-vlist-gpui | 10,000,000 | 3/3 | 81.50 | 591.20 | 0.74 | 1.22 | 1.44 | 3.31 | 153 | 0.46 | 1.54 | 36 | 48 |+| gpui list (SumTree) | 100 | 3/3 | 0.00 | 514.60 | 1.00 | 1.39 | 1.47 | 3.88 | 793 | 0.98 | 1.83 | 30 | 31 |+| gpui list (SumTree) | 10,000 | 3/3 | 0.60 | 506.20 | 1.30 | 1.70 | 1.86 | 3.75 | 939 | 0.91 | 2.60 | 31 | 32 |+| gpui list (SumTree) | 1,000,000 | 3/3 | 57.80 | 370.90 | 1.32 | 1.78 | 1.89 | 3.83 | 982 | 1.05 | 2.58 | 116 | 203 |+| gpui list (SumTree) | 10,000,000 | 3/3 | 537.10 | 1995.20 | 1.44 | 1.87 | 2.03 | 4.02 | 957 | 1.17 | 2.82 | 940 | 1838 |+| gpui-component virtual_list | 100 | 3/3 | 0.10 | 495.50 | 1.04 | 1.46 | 1.56 | 3.87 | 923 | 1.01 | 1.94 | 28 | 29 |+| gpui-component virtual_list | 10,000 | 3/3 | 8.40 | 507.10 | 1.26 | 1.72 | 1.85 | 3.69 | 1035 | 1.12 | 2.10 | 29 | 29 |+| gpui-component virtual_list | 1,000,000 | 3/3 | 627.50 | 835.80 | 1.30 | 1.76 | 1.91 | 3.70 | 1091 | 1.19 | 2.15 | 40 | 46 |+| gpui-component virtual_list | 10,000,000 | 3/3 | 7284.70 | 7842.60 | 1.30 | 1.82 | 2.17 | 3.75 | 984 | 1.27 | 2.23 | 181 | 182 |+| blank (no list) | 1,000,000 | 3/3 | 0.00 | 257.20 | 0.13 | 0.20 | 0.28 | 0.85 | 102 | 0.13 | 0.13 | -169 | 46 |diff --git a/bindings/rust/blenderui-vlist-gpui/bench/run.mjs b/bindings/rust/blenderui-vlist-gpui/bench/run.mjsnew file mode 100644index 0000000..e1207f0--- /dev/null+++ b/bindings/rust/blenderui-vlist-gpui/bench/run.mjs@@ -0,0 +1,69 @@+// Runs the head-to-head (examples/bench_list_gpui.rs) several times per+// library and size, and writes the medians to results.json and results.md.+//+// cargo build --release --features bench --example bench_list_gpui -j 1+// node bench/run.mjs [--reps 3] [--seconds 5] [--sizes 100,10000,1000000,10000000]+//+// One process per run, per library and per size; nothing else should be+// running. A library that runs out of memory (the process itself caps its+// working set above the data at --cap-mb) or time (--limit-seconds) is+// recorded as a failure with how far it got, and the median is taken over+// the runs that finished.++import { spawnSync } from "node:child_process";+import { existsSync, mkdirSync, writeFileSync } from "node:fs";+import { dirname, join } from "node:path";+import { fileURLToPath } from "node:url";++const here = dirname(fileURLToPath(import.meta.url));+const exeName = process.platform === "win32" ? "bench_list_gpui.exe" : "bench_list_gpui";+const candidates = [join(here, "..", "target", "release", "examples", exeName), join(here, "..", "..", "blenderui-table-gpui", "target", "release", "examples", exeName)];+const exe = candidates.find(existsSync);+if (!exe) throw new Error("build the example first");+const arg = (k, d) => { const i = process.argv.indexOf(k); return i > 0 ? process.argv[i + 1] : d; };+const reps = Number(arg("--reps", 3));+const seconds = arg("--seconds", "5");+const sizes = arg("--sizes", "100,10000,1000000,10000000").split(",").map(Number);+const capMb = arg("--cap-mb", "4096");+const limit = arg("--limit-seconds", "150");+const dir = join(here, "..", "target", "bench-logs");+mkdirSync(dir, { recursive: true });++const libs = ["ours", "list", "virtual"];+const median = (xs) => { const s = [...xs].sort((a, b) => a - b); return s[Math.floor((s.length - 1) / 2)]; };++const results = [];+const run = (lib, n) => {+ const runs = [], fails = [];+ for (let i = 0; i < reps; i++) {+ const r = spawnSync(exe, ["--lib", lib, "--n", String(n), "--seconds", seconds, "--cap-mb", capMb, "--limit-seconds", limit, "--dir", dir], { encoding: "utf8", timeout: (Number(limit) + 120) * 1000 });+ const line = (r.stdout || "").split("\n").find((l) => l.startsWith("{"));+ if (!line) { fails.push({ failed: `no output (exit ${r.status})`, stderr: (r.stderr || "").slice(-300) }); console.error(`${lib} ${n} run ${i + 1}: no output`); continue; }+ const j = JSON.parse(line);+ if (j.failed) { fails.push(j); console.error(`${lib} ${n} run ${i + 1}: FAILED ${j.failed} in ${j.stage} after ${j.elapsed_s}s, ${j.ram_above_data_mb} MB`); continue; }+ runs.push(j);+ console.error(`${lib} ${n} run ${i + 1}: p50 ${j.frame_ms_p50} ms, first ${j.first_frame_ms} ms`);+ }+ const out = { lib: runs[0]?.lib ?? fails[0]?.lib ?? lib, n, finished: runs.length, failed: fails.length, failures: fails };+ if (runs.length) for (const k of Object.keys(runs[0])) if (typeof runs[0][k] === "number" && !(k in out)) out[k] = median(runs.map((r) => r[k]));+ results.push(out);+ // a library that fails at one size will fail at the next: do not burn the time limit again+ return runs.length > 0;+};++for (const lib of libs) {+ let alive = true;+ for (const n of sizes) { if (!alive) { results.push({ lib, n, finished: 0, failed: 0, skipped: "failed at a smaller size" }); continue; } alive = run(lib, n); }+}+run("blank", sizes.includes(1000000) ? 1000000 : sizes[0]);+writeFileSync(join(here, "results.json"), JSON.stringify(results, null, 2));++const cols = [["setup_ms", "Setup ms"], ["first_frame_ms", "First frame ms"], ["frame_ms_p50", "Scroll p50 ms"], ["frame_ms_p95", "p95"], ["frame_ms_p99", "p99"], ["cpu_ms_per_frame", "CPU ms/frame"], ["main_allocs_per_frame", "Allocs/frame"], ["still_frame_ms_p50", "Repaint p50 ms"], ["jump_ms_p50", "Jump p50 ms"], ["ram_above_data_mb", "RAM above data MB"], ["peak_above_data_mb", "Peak MB"]];+let md = `| Library | Items | Finished | ${cols.map((c) => c[1]).join(" | ")} |\n|---|---:|---:|${cols.map(() => "---:").join("|")}|\n`;+for (const r of results) {+ if (r.skipped) { md += `| ${r.lib} | ${r.n.toLocaleString("en-US")} | skipped (${r.skipped}) |${cols.map(() => " |").join("")}\n`; continue; }+ if (!r.finished) { const f = r.failures[0] ?? {}; md += `| ${r.lib} | ${r.n.toLocaleString("en-US")} | 0/${reps}: ${f.failed ?? "failed"} in ${f.stage ?? "?"} after ${f.elapsed_s ?? "?"} s, ${f.ram_above_data_mb ?? "?"} MB |${cols.map(() => " |").join("")}\n`; continue; }+ md += `| ${r.lib} | ${r.n.toLocaleString("en-US")} | ${r.finished}/${reps} | ${cols.map(([k]) => (r[k] ?? 0).toFixed(k.includes("allocs") ? 0 : k.includes("mb") ? 0 : 2)).join(" | ")} |\n`;+}+writeFileSync(join(here, "results.md"), md);+console.log(md);diff --git a/bindings/rust/blenderui-vlist-gpui/examples/bench_list_gpui.rs b/bindings/rust/blenderui-vlist-gpui/examples/bench_list_gpui.rsnew file mode 100644index 0000000..6e1a1df--- /dev/null+++ b/bindings/rust/blenderui-vlist-gpui/examples/bench_list_gpui.rs@@ -0,0 +1,574 @@+//! Head-to-head on the same gpui (gpui-pre 0.3.11), the same chat messages+//! and the same window: this crate's variable list vs gpui's own `list`+//! (variable height, a `SumTree`, items are elements) vs gpui-component+//! 0.9.0's `virtual_list` (variable item sizes, which the caller must supply+//! for every item up front).+//!+//! ```text+//! cargo build --release --features bench --example bench_list_gpui -j 1+//! node bench/run.mjs # per size, 3 runs per library, medians+//! target/release/examples/bench_list_gpui.exe --lib ours --n 1000000+//! ```+//!+//! One process runs one library at one size and prints one JSON line.+//! A watchdog thread ends the process (still printing a JSON line that says+//! what failed and how far it got) when it exceeds a memory cap or a time+//! limit, so a library that cannot hold a size does not take the machine+//! down. 10M messages come from the file-backed log in all three (the+//! competitors fetch each row's record from it when they render it).+//!+//! Measured per library:+//!+//! * `setup_ms`: building the library's state for `n` items (ours: the height+//! index; `list`: the SumTree; `virtual_list`: measuring every message for+//! the sizes it needs, with the same wrapping function).+//! * `first_frame_ms`: process start (after the data exists) to the first+//! painted frame, opened at the newest message.+//! * scroll: continuous, 57 px per frame, from the middle of the list:+//! per-frame **render to end of paint** on the main thread (GPU submission+//! and vsync wait excluded), p50/p95/p99, frames per second, process CPU+//! time per frame (all threads), heap allocations per frame (UI thread).+//! * still: repainting a fixed position (the steady-state cost).+//! * jump: 40 jumps to random items, render-to-paint of the landing frame.+//! * memory: working set above the baseline taken before anything was built.+//!+//! Caveat that favours the competitors: `virtual_list` is given sizes+//! computed with a cheap synthetic text width, so its rows may wrap+//! differently from what it draws; `list` measures real elements. Ours+//! measures with gpui's real text shaper.++#![allow(clippy::too_many_lines, clippy::all, clippy::pedantic)]++#[path = "../../bench/common/measure.rs"]+mod measure;++use std::alloc::{GlobalAlloc, Layout, System};+use std::cell::Cell as StdCell;+use std::ops::Range;+use std::path::PathBuf;+use std::rc::Rc;+use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering};+use std::sync::Mutex;+use std::time::{Duration, Instant};++use blenderui_vlist_gpui as ours;+use blenderui_vlist_gpui::{Align, ItemSource, Options};+use blenderui_vlist::log::{LogSource, LogWriter};+use blenderui_vlist::source::{Page, Record, FLAG_DIVIDER, FLAG_HEADER};+use blenderui_vlist::{synth, ChatStyle, Measurer, TextLayout, VecSource};+use gpui::{+ AnyElement, App, AppContext as _, Bounds, Context, Entity, IntoElement, ListAlignment, ListOffset, ListState, ParentElement as _,+ Render, ScrollStrategy, SharedString, Size, Styled as _, Window, WindowBounds, WindowOptions, canvas, div, list, point, px, rgb, size,+};+use gpui_component as comp;++// ---- counting allocator -----------------------------------------------------------------------------++struct Counting;+static ALLOCS: AtomicU64 = AtomicU64::new(0);+thread_local! {+ static MAIN_ALLOCS: StdCell<u64> = const { StdCell::new(0) };+}++// SAFETY: forwards to the system allocator; the counters are an atomic and a const thread-local.+unsafe impl GlobalAlloc for Counting {+ unsafe fn alloc(&self, l: Layout) -> *mut u8 {+ ALLOCS.fetch_add(1, Ordering::Relaxed);+ let _ = MAIN_ALLOCS.try_with(|c| c.set(c.get() + 1));+ unsafe { System.alloc(l) }+ }+ unsafe fn dealloc(&self, p: *mut u8, l: Layout) {+ unsafe { System.dealloc(p, l) }+ }+ unsafe fn realloc(&self, p: *mut u8, l: Layout, n: usize) -> *mut u8 {+ ALLOCS.fetch_add(1, Ordering::Relaxed);+ let _ = MAIN_ALLOCS.try_with(|c| c.set(c.get() + 1));+ unsafe { System.realloc(p, l, n) }+ }+}++#[global_allocator]+static A: Counting = Counting;++fn main_allocs() -> u64 {+ MAIN_ALLOCS.with(StdCell::get)+}++// ---- the window ---------------------------------------------------------------------------------------++const W: f32 = 700.0;+const H: f32 = 600.0;+const SCROLL_PX: f32 = 57.0;++#[derive(Clone, Copy, PartialEq, Eq)]+enum Lib {+ Ours,+ GpuiList,+ Virtual,+ Blank,+}++static SCROLLING: AtomicBool = AtomicBool::new(false);+static REPAINT: AtomicBool = AtomicBool::new(false);+static RECORDING: AtomicBool = AtomicBool::new(false);+static FRAMES: AtomicU64 = AtomicU64::new(0);+static LAST_NS: AtomicU64 = AtomicU64::new(0);+static TIMES: Mutex<Vec<f64>> = Mutex::new(Vec::new());+static STAGE: AtomicUsize = AtomicUsize::new(0);+const STAGES: [&str; 6] = ["setup", "first frame", "scroll", "still", "jump", "done"];++thread_local! {+ static FRAME_START: StdCell<Option<Instant>> = const { StdCell::new(None) };+}++type Dyn = Rc<dyn ItemSource>;++#[derive(Clone)]+enum View {+ Ours(Entity<ours::ListState<Dyn, ChatStyle>>),+ List(ListState, Dyn),+ Virtual(Entity<Rows>, comp::VirtualListScrollHandle, Rc<Vec<Size<gpui::Pixels>>>),+ Blank,+}++/// The rows `virtual_list` renders for a visible range.+struct Rows {+ src: Dyn,+ page: Page,+}++impl Render for Rows {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ div()+ }+}++struct Harness {+ view: View,+ frame: usize,+}++/// One chat row as a tree of gpui elements (what `list` and `virtual_list` need).+fn row(rec: &Record<'_>) -> AnyElement {+ let dim = rgb(0x8a8a8a);+ let mut col = div().flex().flex_col().w(px(W - 10.0 - 32.0 - 10.0 - 10.0 - 10.0)).text_size(px(14.0)).line_height(px(19.0)).text_color(rgb(0xe6e6e6));+ if rec.flags & FLAG_HEADER != 0 {+ col = col.child(+ div().h(px(20.0)).flex().gap(px(8.0)).child(SharedString::from(format!("User {}", rec.sender))).child(div().text_color(dim).child(SharedString::from(format!(+ "{:02}:{:02}",+ rec.time % 86_400 / 3600,+ rec.time / 60 % 60+ )))),+ );+ }+ col = col.child(SharedString::from(rec.text.to_owned()));+ if rec.media_h > 0 {+ col = col.child(div().mt(px(3.0)).h(px(f32::from(rec.media_h))).rounded(px(4.0)).bg(rgb(0x3a3a3a)));+ }+ let avatar = if rec.flags & FLAG_HEADER != 0 {+ div().size(px(32.0)).rounded_full().bg(rgb(0x4d70b3)).flex().justify_center().items_center().child(SharedString::from(((b'A' + (rec.sender % 26) as u8) as char).to_string()))+ } else {+ div().w(px(32.0))+ };+ let mut r = div().w_full().flex().flex_col();+ if rec.flags & FLAG_DIVIDER != 0 {+ r = r.child(div().h(px(30.0)).flex().justify_center().items_center().text_size(px(13.0)).text_color(dim).child("2023-11-14"));+ }+ r.child(div().flex().gap(px(10.0)).px(px(10.0)).pt(px(if rec.flags & FLAG_HEADER != 0 { 10.0 } else { 1.0 })).pb(px(3.0)).child(avatar).child(col)).into_any_element()+}++thread_local! {+ static VIEW: StdCell<Option<View>> = const { StdCell::new(None) };+}++fn view() -> View {+ let v = VIEW.take();+ let c = v.clone().expect("the view exists");+ VIEW.set(v);+ c+}++impl Render for Harness {+ fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {+ FRAME_START.set(Some(Instant::now()));+ self.frame += 1;+ if SCROLLING.load(Ordering::Relaxed) {+ match &self.view {+ View::Ours(s) => {+ s.update(cx, |s, _| s.view.scroll_by(f64::from(SCROLL_PX)));+ }+ View::List(s, _) => s.scroll_by(px(SCROLL_PX)),+ View::Virtual(_, h, _) => {+ let o = h.base_handle().offset();+ h.base_handle().set_offset(point(o.x, o.y - px(SCROLL_PX)));+ }+ View::Blank => {}+ }+ }+ if REPAINT.load(Ordering::Relaxed) {+ window.request_animation_frame();+ }+ let holder = div().w(px(W)).h(px(H));+ let body = match &self.view {+ View::Ours(s) => holder.child(ours::variable_list(s)).into_any_element(),+ View::List(s, src) => {+ let src = src.clone();+ holder+ .child(+ list(s.clone(), move |ix, _, _| {+ let mut page = Page::new();+ src.fetch(ix..ix + 1, &mut page);+ page.record(ix).map_or_else(|| div().into_any_element(), |r| row(&r))+ })+ .size_full(),+ )+ .into_any_element()+ }+ View::Virtual(rows, h, sizes) => holder+ .child(+ comp::v_virtual_list(rows.clone(), "rows", sizes.clone(), |rows: &mut Rows, range: Range<usize>, _, _| {+ rows.src.fetch(range.clone(), &mut rows.page);+ range.filter_map(|i| rows.page.record(i).map(|r| row(&r))).collect::<Vec<_>>()+ })+ .track_scroll(h),+ )+ .into_any_element(),+ View::Blank => holder.into_any_element(),+ };+ div().size_full().bg(rgb(0x1d1d1d)).child(body).child(canvas(|_, _, _| (), |_, (), _, _| frame_painted()).absolute().size(px(0.0)))+ }+}++fn frame_painted() {+ let Some(t0) = FRAME_START.get() else { return };+ let ns = t0.elapsed().as_nanos() as u64;+ LAST_NS.store(ns, Ordering::Relaxed);+ FRAMES.fetch_add(1, Ordering::Relaxed);+ if RECORDING.load(Ordering::Relaxed) {+ TIMES.lock().unwrap().push(ns as f64 / 1e6);+ }+}++// ---- statistics -----------------------------------------------------------------------------------------++fn pct(sorted: &[f64], p: f64) -> f64 {+ if sorted.is_empty() {+ return 0.0;+ }+ sorted[(((sorted.len() - 1) as f64) * p).round() as usize]+}++fn mb(b: usize) -> f64 {+ b as f64 / (1024.0 * 1024.0)+}++fn ms(d: Duration) -> f64 {+ d.as_secs_f64() * 1000.0+}++struct Args {+ lib: Lib,+ n: usize,+ secs: f64,+ warm: f64,+ dir: PathBuf,+ cap_mb: f64,+ limit_s: f64,+}++fn args() -> Args {+ let a: Vec<String> = std::env::args().collect();+ let get = |k: &str, d: &str| a.iter().position(|x| x == k).and_then(|i| a.get(i + 1)).cloned().unwrap_or_else(|| d.to_owned());+ Args {+ lib: match get("--lib", "ours").as_str() {+ "list" => Lib::GpuiList,+ "virtual" => Lib::Virtual,+ "blank" => Lib::Blank,+ _ => Lib::Ours,+ },+ n: get("--n", "100000").parse().unwrap(),+ secs: get("--seconds", "6").parse().unwrap(),+ warm: get("--warmup", "2").parse().unwrap(),+ dir: PathBuf::from(get("--dir", "target/bench-logs")),+ cap_mb: get("--cap-mb", "4096").parse().unwrap(),+ limit_s: get("--limit-seconds", "150").parse().unwrap(),+ }+}++fn lib_name(l: Lib) -> &'static str {+ match l {+ Lib::Ours => "blenderui-vlist-gpui",+ Lib::GpuiList => "gpui list (SumTree)",+ Lib::Virtual => "gpui-component virtual_list",+ Lib::Blank => "blank (no list)",+ }+}++/// Bits of the setup time (ms) for the watchdog report.+static SETUP_MS_BITS: AtomicU64 = AtomicU64::new(0);++/// Ends the process, printing what failed, when memory or time run out.+fn watchdog(a: &Args, base_ws: usize) {+ let (cap, limit, lib, n) = (a.cap_mb, a.limit_s, lib_name(a.lib), a.n);+ let start = Instant::now();+ std::thread::spawn(move || {+ loop {+ std::thread::sleep(Duration::from_millis(100));+ let ws = measure::memory().working_set;+ let over = mb(ws) - mb(base_ws);+ let why = if over > cap {+ Some("memory cap")+ } else if start.elapsed().as_secs_f64() > limit {+ Some("time limit")+ } else {+ None+ };+ if let Some(why) = why {+ println!(+ "{{\"lib\":\"{lib}\",\"n\":{n},\"failed\":\"{why}\",\"stage\":\"{}\",\"elapsed_s\":{:.1},\"ram_above_data_mb\":{:.0},\"setup_ms\":{:.0},\"cap_mb\":{cap:.0},\"limit_s\":{limit:.0}}}",+ STAGES[STAGE.load(Ordering::Relaxed).min(5)],+ start.elapsed().as_secs_f64(),+ over,+ f64::from_bits(SETUP_MS_BITS.load(Ordering::Relaxed)),+ );+ std::process::exit(3);+ }+ }+ });+}++/// The data: in memory up to a million messages, the file-backed log above.+fn make_source(a: &Args) -> Dyn {+ if a.n <= 1_000_000 {+ return Rc::new(VecSource::from_messages(synth::messages(0, a.n as u64)));+ }+ std::fs::create_dir_all(&a.dir).expect("dir");+ let base = a.dir.join(format!("chat{}", a.n));+ if LogSource::open(&base).map(|s| s.len()).unwrap_or(0) != a.n {+ let mut w = LogWriter::create(&base).expect("create log");+ let mut prev = None;+ for i in 0..a.n as u64 {+ let mut m = synth::message(i);+ m.flags = blenderui_vlist::chat::classify(prev, m.sender, m.time);+ prev = Some((m.sender, m.time));+ w.append(&m).expect("write");+ }+ w.finish().expect("flush");+ }+ Rc::new(LogSource::open(&base).expect("open log"))+}++/// The heights `virtual_list` needs, one per message, from our wrapping.+fn virtual_sizes(src: &Dyn) -> Rc<Vec<Size<gpui::Pixels>>> {+ let style = ChatStyle::new(ours::Palette::blender_dark());+ let mut text = TextLayout::new(4096);+ let mut tw = |s: &str, z: f32| s.len() as f32 * z * 0.5;+ let mut page = Page::new();+ let mut sizes = Vec::with_capacity(src.len());+ let mut start = 0;+ while start < src.len() {+ let end = (start + 4096).min(src.len());+ src.fetch(start..end, &mut page);+ for i in start..end {+ let h = page.record(i).map_or(60.0, |r| text.height(&r, &style, W, &mut tw).px() as f32);+ sizes.push(size(px(W), px(h)));+ }+ text.next_generation();+ start = end;+ }+ Rc::new(sizes)+}++/// Wait until a frame has been painted after this call.+async fn next_frame(cx: &mut gpui::AsyncApp) {+ let n = FRAMES.load(Ordering::Relaxed);+ let t0 = Instant::now();+ while FRAMES.load(Ordering::Relaxed) == n && t0.elapsed() < Duration::from_millis(2000) {+ cx.background_executor().timer(Duration::from_millis(1)).await;+ }+}++struct Stage {+ frames: u64,+ fps: f64,+ mean: f64,+ p50: f64,+ p95: f64,+ p99: f64,+ max: f64,+ cpu_ms: f64,+ main_allocs: f64,+}++async fn stage(cx: &mut gpui::AsyncApp, handle: gpui::AnyWindowHandle, warm: f64, secs: f64, hz: f64, scroll: bool) -> Stage {+ SCROLLING.store(scroll, Ordering::Relaxed);+ REPAINT.store(true, Ordering::Relaxed);+ let _ = cx.update(|app| handle.update(app, |_, window, _| window.refresh()));+ cx.background_executor().timer(Duration::from_secs_f64(warm)).await;+ TIMES.lock().unwrap().clear();+ let (f0, c0, w0) = (FRAMES.load(Ordering::Relaxed), measure::cpu_cycles(), Instant::now());+ let m0 = cx.update(|_| main_allocs());+ RECORDING.store(true, Ordering::Relaxed);+ cx.background_executor().timer(Duration::from_secs_f64(secs)).await;+ RECORDING.store(false, Ordering::Relaxed);+ let (frames, wall) = (FRAMES.load(Ordering::Relaxed) - f0, w0.elapsed());+ let cpu = Duration::from_secs_f64((measure::cpu_cycles() - c0) as f64 / hz);+ let main_allocs = cx.update(|_| main_allocs()) - m0;+ SCROLLING.store(false, Ordering::Relaxed);+ REPAINT.store(false, Ordering::Relaxed);+ let mut t = std::mem::take(&mut *TIMES.lock().unwrap());+ t.sort_by(f64::total_cmp);+ let n = frames.max(1) as f64;+ Stage {+ frames,+ fps: frames as f64 / wall.as_secs_f64(),+ mean: t.iter().sum::<f64>() / t.len().max(1) as f64,+ p50: pct(&t, 0.5),+ p95: pct(&t, 0.95),+ p99: pct(&t, 0.99),+ max: t.last().copied().unwrap_or(0.0),+ cpu_ms: cpu.as_secs_f64() * 1000.0 / n,+ main_allocs: main_allocs as f64 / n,+ }+}++fn main() {+ let t_start = Instant::now();+ let a = args();+ let hz = std::thread::spawn(|| measure::tsc_hz(Duration::from_millis(300)));+ let src = make_source(&a);+ let data_ms = ms(t_start.elapsed());+ let base = measure::memory();+ watchdog(&a, base.working_set);+ let hz = hz.join().unwrap();+ let app = gpui_platform::application().with_assets(gpui_kit_assets::Assets);+ app.run(move |cx: &mut App| {+ comp::init(cx);+ let bounds = Bounds::centered(None, size(px(W + 40.0), px(H + 40.0)), cx);+ let lib = a.lib;+ let n = a.n;+ let src2 = src.clone();+ let window = cx+ .open_window(WindowOptions { window_bounds: Some(WindowBounds::Windowed(bounds)), ..Default::default() }, move |window, cx| {+ let t = Instant::now();+ let view = match lib {+ Lib::Ours => {+ let list = ours::List::new(src2.clone(), ChatStyle::new(ours::Palette::blender_dark()), W, H, Options { start_at_end: true, ..Options::default() }).expect("index");+ View::Ours(cx.new(|cx| ours::ListState::new(list, cx)))+ }+ Lib::GpuiList => {+ let s = ListState::new(n, ListAlignment::Bottom, px(200.0));+ s.scroll_to_end();+ View::List(s, src2.clone())+ }+ Lib::Virtual => {+ let sizes = virtual_sizes(&src2);+ let h = comp::VirtualListScrollHandle::new();+ h.scroll_to_bottom();+ View::Virtual(cx.new(|_| Rows { src: src2.clone(), page: Page::new() }), h, sizes)+ }+ Lib::Blank => View::Blank,+ };+ SETUP_MS_BITS.store(ms(t.elapsed()).to_bits(), Ordering::Relaxed);+ STAGE.store(1, Ordering::Relaxed);+ VIEW.set(Some(view.clone()));+ let root = cx.new(|_| Harness { view, frame: 0 });+ cx.new(|cx| comp::Root::new(root, window, cx))+ })+ .unwrap();+ let handle = window.into();+ cx.activate(true);+ cx.spawn(async move |cx| run(cx, handle, a, t_start, data_ms, base.working_set, hz).await).detach();+ });+}++async fn run(cx: &mut gpui::AsyncApp, handle: gpui::AnyWindowHandle, a: Args, t_start: Instant, data_ms: f64, base_ws: usize, hz: f64) {+ while FRAMES.load(Ordering::Relaxed) == 0 {+ cx.background_executor().timer(Duration::from_millis(1)).await;+ }+ let first_frame_ms = ms(t_start.elapsed()) - data_ms;+ cx.background_executor().timer(Duration::from_millis(300)).await;+ let setup_ms = f64::from_bits(SETUP_MS_BITS.load(Ordering::Relaxed));+ let n = a.n;++ // move to the middle (the scroll stage starts there), then scroll continuously+ let _ = cx.update(|app| {+ handle.update(app, |_, window, app| {+ match view() {+ View::Ours(s) => s.update(app, |s, _| s.view.jump_to(n / 2, Align::Start)),+ View::List(s, _) => s.scroll_to(ListOffset { item_ix: n / 2, offset_in_item: px(0.0) }),+ View::Virtual(_, h, _) => h.scroll_to_item(n / 2, ScrollStrategy::Top),+ View::Blank => {}+ }+ window.refresh();+ })+ });+ next_frame(cx).await;+ STAGE.store(2, Ordering::Relaxed);+ let scroll = stage(cx, handle, a.warm, a.secs, hz, true).await;+ let after = measure::memory();+ STAGE.store(3, Ordering::Relaxed);+ let still = stage(cx, handle, 1.0, (a.secs / 2.0).max(2.0), hz, false).await;++ // jumps to random items+ STAGE.store(4, Ordering::Relaxed);+ let mut jumps = Vec::new();+ let mut x = 0x9E37_79B9_7F4A_7C15u64;+ for _ in 0..40 {+ x ^= x << 13;+ x ^= x >> 7;+ x ^= x << 17;+ let item = (x % n as u64) as usize;+ let t = Instant::now();+ let _ = cx.update(|app| {+ handle.update(app, |_, window, app| {+ match view() {+ View::Ours(s) => s.update(app, |s, _| s.view.jump_to(item, Align::Start)),+ View::List(s, _) => s.scroll_to(ListOffset { item_ix: item, offset_in_item: px(0.0) }),+ View::Virtual(_, h, _) => h.scroll_to_item(item, ScrollStrategy::Top),+ View::Blank => {}+ }+ window.refresh();+ })+ });+ let dispatch = ms(t.elapsed());+ next_frame(cx).await;+ jumps.push(dispatch + LAST_NS.load(Ordering::Relaxed) as f64 / 1e6);+ cx.background_executor().timer(Duration::from_millis(30)).await;+ }+ jumps.sort_by(f64::total_cmp);+ STAGE.store(5, Ordering::Relaxed);+ let end = measure::memory();+ println!(+ "{{\"lib\":\"{}\",\"n\":{},\"data_ms\":{:.0},\"setup_ms\":{:.1},\"first_frame_ms\":{:.1},\"scroll_frames\":{},\"fps\":{:.1},\+ \"frame_ms_mean\":{:.3},\"frame_ms_p50\":{:.3},\"frame_ms_p95\":{:.3},\"frame_ms_p99\":{:.3},\"frame_ms_max\":{:.3},\+ \"cpu_ms_per_frame\":{:.3},\"main_allocs_per_frame\":{:.1},\+ \"still_frame_ms_p50\":{:.3},\"still_cpu_ms_per_frame\":{:.3},\"still_main_allocs_per_frame\":{:.1},\+ \"jump_ms_p50\":{:.3},\"jump_ms_p95\":{:.3},\"jump_ms_max\":{:.3},\+ \"ram_above_data_mb\":{:.1},\"peak_above_data_mb\":{:.1},\"private_mb\":{:.1}}}",+ lib_name(a.lib),+ a.n,+ data_ms,+ setup_ms,+ first_frame_ms,+ scroll.frames,+ scroll.fps,+ scroll.mean,+ scroll.p50,+ scroll.p95,+ scroll.p99,+ scroll.max,+ scroll.cpu_ms,+ scroll.main_allocs,+ still.p50,+ still.cpu_ms,+ still.main_allocs,+ pct(&jumps, 0.5),+ pct(&jumps, 0.95),+ jumps.last().copied().unwrap_or(0.0),+ mb(after.working_set) - mb(base_ws),+ mb(end.peak_working_set) - mb(base_ws),+ mb(end.private_bytes),+ );+ std::process::exit(0);+}diff --git a/bindings/rust/blenderui-vlist-gpui/src/element.rs b/bindings/rust/blenderui-vlist-gpui/src/element.rsnew file mode 100644index 0000000..675c059--- /dev/null+++ b/bindings/rust/blenderui-vlist-gpui/src/element.rs@@ -0,0 +1,196 @@+//! [`VariableList`]: the element that shows a [`ListState`].+//!+//! A frame builds **two** elements however many items there are: a+//! focus-tracking wrapper that takes key input, and [`ListElement`], a custom+//! gpui `Element` that lays out as one box, lays the list's frame out in+//! `prepaint` (measuring what is unmeasured, with the shaper) and in `paint`+//! draws the placed items with `Window::paint_quad` and shaped lines (via+//! `blenderui_vlist::List::paint`) and registers the pointer listeners.++use std::rc::Rc;++use blenderui_vlist::{ChatStyle, Hit, ItemPainter, ItemSource, List, Measurer, VecSource};+use gpui::{+ App, Bounds, ContentMask, DispatchPhase, Element, ElementId, Entity, GlobalElementId, Hitbox, HitboxBehavior,+ InspectorElementId, InteractiveElement as _, IntoElement, KeyDownEvent, LayoutId, MouseButton, MouseDownEvent, MouseMoveEvent,+ MouseUpEvent, ParentElement as _, Pixels, RenderOnce, ScrollDelta, ScrollEvent, Style, Styled as _,+ Window, div, px, relative,+};++use crate::state::ListState;++type Listener<S, P> = Rc<dyn Fn(usize, &mut List<S, P>)>;++/// A line of text in px, for keyboard and wheel steps.+const LINE_PX: f64 = 19.0;++/// A variable-height list over `state`.+#[derive(IntoElement)]+pub struct VariableList<S: ItemSource + 'static, P: Measurer + ItemPainter + 'static> {+ state: Entity<ListState<S, P>>,+ on_item_click: Option<Listener<S, P>>,+}++/// The element for a list state.+pub fn variable_list<S: ItemSource, P: Measurer + ItemPainter>(state: &Entity<ListState<S, P>>) -> VariableList<S, P> {+ VariableList { state: state.clone(), on_item_click: None }+}++/// A chat: a [`VariableList`] over a chat where a click selects a whole message.+#[must_use]+pub fn chat_list(state: &Entity<ListState<VecSource, ChatStyle>>) -> VariableList<VecSource, ChatStyle> {+ variable_list(state).on_item_click(|i, list| list.toggle_selected(i))+}++impl<S: ItemSource, P: Measurer + ItemPainter> VariableList<S, P> {+ /// An item was clicked (item index). The closure may change the list.+ #[must_use]+ pub fn on_item_click(mut self, f: impl Fn(usize, &mut List<S, P>) + 'static) -> Self {+ self.on_item_click = Some(Rc::new(f));+ self+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> RenderOnce for VariableList<S, P> {+ fn render(self, _: &mut Window, cx: &mut App) -> impl IntoElement {+ let Self { state, on_item_click } = self;+ let focus = gpui::Focusable::focus_handle(state.read(cx), cx);+ let key_state = state.clone();+ div()+ .id(("blenderui-variable-list", state.entity_id()))+ .size_full()+ .relative()+ .overflow_hidden()+ .track_focus(&focus)+ .key_context("VariableList")+ .on_key_down(move |e: &KeyDownEvent, window, cx| {+ let handled = key_state.update(cx, |s, _| s.key(&e.keystroke.key, LINE_PX));+ if handled {+ window.refresh();+ cx.stop_propagation();+ }+ })+ .child(ListElement { state, on_item_click })+ }+}++/// What `prepaint` found for `paint`.+struct Prepaint {+ hitbox: Hitbox,+}++/// The custom element: see the module docs.+struct ListElement<S: ItemSource + 'static, P: Measurer + ItemPainter + 'static> {+ state: Entity<ListState<S, P>>,+ on_item_click: Option<Listener<S, P>>,+}++impl<S: ItemSource, P: Measurer + ItemPainter> IntoElement for ListElement<S, P> {+ type Element = Self;+ fn into_element(self) -> Self {+ self+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> Element for ListElement<S, P> {+ type RequestLayoutState = ();+ type PrepaintState = Prepaint;++ fn id(&self) -> Option<ElementId> {+ None+ }++ fn source_location(&self) -> Option<&'static core::panic::Location<'static>> {+ None+ }++ fn request_layout(&mut self, _: Option<&GlobalElementId>, _: Option<&InspectorElementId>, window: &mut Window, cx: &mut App) -> (LayoutId, ()) {+ let mut style = Style::default();+ style.size.width = relative(1.0).into();+ style.size.height = relative(1.0).into();+ (window.request_layout(style, [], cx), ())+ }++ fn prepaint(+ &mut self,+ _: Option<&GlobalElementId>,+ _: Option<&InspectorElementId>,+ bounds: Bounds<Pixels>,+ &mut (): &mut (),+ window: &mut Window,+ cx: &mut App,+ ) -> Prepaint {+ self.state.update(cx, |s, cx| s.sync(bounds, window, cx));+ Prepaint { hitbox: window.insert_hitbox(bounds, HitboxBehavior::Normal) }+ }++ fn paint(+ &mut self,+ _: Option<&GlobalElementId>,+ _: Option<&InspectorElementId>,+ bounds: Bounds<Pixels>,+ &mut (): &mut (),+ pre: &mut Prepaint,+ window: &mut Window,+ cx: &mut App,+ ) {+ window.with_content_mask(Some(ContentMask { bounds }), |window| {+ self.state.update(cx, |s, cx| s.paint_into(window, cx, bounds.origin));+ });+ self.register_input(bounds, &pre.hitbox, window);+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> ListElement<S, P> {+ /// Pointer and wheel listeners, for this frame.+ fn register_input(&self, bounds: Bounds<Pixels>, hitbox: &Hitbox, window: &mut Window) {+ let origin = bounds.origin;+ let (state, click, hb) = (self.state.clone(), self.on_item_click.clone(), hitbox.clone());+ window.on_mouse_event(move |e: &MouseDownEvent, phase, window, cx| {+ if phase != DispatchPhase::Bubble || e.button != MouseButton::Left || !hb.is_hovered(window) {+ return;+ }+ let focus = gpui::Focusable::focus_handle(state.read(cx), cx);+ window.focus(&focus, cx);+ let (x, y) = (f32::from(e.position.x - origin.x), f32::from(e.position.y - origin.y));+ state.update(cx, |s, _| {+ if let Hit::Item(i) = s.pointer_down(x, y)+ && let Some(f) = &click+ {+ f(i, s);+ }+ });+ window.refresh();+ });+ let (state, hb) = (self.state.clone(), hitbox.clone());+ window.on_mouse_event(move |e: &MouseMoveEvent, phase, window, cx| {+ if phase != DispatchPhase::Bubble || !(state.read(cx).dragging() || hb.is_hovered(window)) {+ return;+ }+ let y = f32::from(e.position.y - origin.y);+ let moved = state.update(cx, |s, _| if e.pressed_button.is_none() { s.pointer_up(); false } else { s.pointer_move(y) });+ if moved {+ window.refresh();+ }+ });+ let state = self.state.clone();+ window.on_mouse_event(move |e: &MouseUpEvent, phase, _, cx| {+ if phase == DispatchPhase::Bubble && e.button == MouseButton::Left {+ state.update(cx, |s, _| s.pointer_up());+ }+ });+ let (state, hb) = (self.state.clone(), hitbox.clone());+ window.on_mouse_event(move |e: &ScrollEvent, phase, window, cx| {+ if phase != DispatchPhase::Bubble || !hb.is_hovered(window) {+ return;+ }+ let precise = matches!(e.delta, ScrollDelta::Pixels(_));+ let d = e.delta.pixel_delta(px(LINE_PX as f32));+ // content follows the wheel: a negative delta scrolls down+ let dy = -f64::from(f32::from(d.y));+ state.update(cx, |s, _| s.view.wheel(dy, precise));+ window.request_animation_frame();+ cx.stop_propagation();+ });+ }+}diff --git a/bindings/rust/blenderui-vlist-gpui/src/lib.rs b/bindings/rust/blenderui-vlist-gpui/src/lib.rsnew file mode 100644index 0000000..da9a8ed--- /dev/null+++ b/bindings/rust/blenderui-vlist-gpui/src/lib.rs@@ -0,0 +1,28 @@+//! A variable-height virtualized list for gpui, chat-grade, from 100 items to+//! 10M+: the framework-independent `blenderui-vlist` core (a Fenwick-over-+//! blocks height index, anchor-based scrolling, wrapped-text measuring, item+//! sources) painted straight into the window's scene by one custom gpui+//! `Element`: a frame builds a constant number of elements however many items+//! there are, and paints only the visible ones.+//!+//! * [`ListState`]: the entity around a [`List`] (items, style, view);+//! * [`VariableList`] ([`variable_list`], [`chat_list`]): the element, with+//! pointer, wheel and keyboard input.+//!+//! ```ignore+//! use blenderui_vlist_gpui::*;+//!+//! let chat = cx.new(|cx| ListState::new(ChatList::from_messages(msgs, Palette::blender_dark(), 600.0, 400.0, Options::default()), cx));+//! // in render+//! div().size_full().child(chat_list(&chat))+//! ```++mod element;+mod state;++pub use blenderui_vlist::{+ Align, Budget, ChatList, ChatStyle, Hit, ItemPainter, ItemSource, List, ListView, Measurer, Message, Nav, Options, Palette, Record,+ VecSource, log, synth,+};+pub use element::{VariableList, chat_list, variable_list};+pub use state::ListState;diff --git a/bindings/rust/blenderui-vlist-gpui/src/state.rs b/bindings/rust/blenderui-vlist-gpui/src/state.rsnew file mode 100644index 0000000..d5c3275--- /dev/null+++ b/bindings/rust/blenderui-vlist-gpui/src/state.rs@@ -0,0 +1,99 @@+//! [`ListState`]: the entity around a [`List`], like the data table's+//! `TableState`: the core's API reads as the state's own through `Deref`; what+//! is here needs gpui (the focus handle, the shaped-line cache, the frame clock).++use std::ops::{Deref, DerefMut};+use std::time::{Duration, Instant};++use blenderui_paint_gpui::GpuiSink;+use blenderui_vlist::{Budget, ItemPainter, ItemSource, List, Measurer, TextCache};+use gpui::{App, Bounds, Context, FocusHandle, Focusable, Pixels, ShapedLine, Window};++/// Shaped runs kept across frames (one per distinct line shown).+const TEXT_CACHE_CAPACITY: usize = 8192;++/// The list.+pub struct ListState<S: ItemSource + 'static, P: Measurer + ItemPainter + 'static> {+ list: List<S, P>,+ focus: FocusHandle,+ /// Shaped text kept across frames: scrolling moves the same lines.+ pub(crate) text: TextCache<ShapedLine>,+ pub(crate) text_scale: f32,+ last_frame: Option<Instant>,+}++impl<S: ItemSource, P: Measurer + ItemPainter> Deref for ListState<S, P> {+ type Target = List<S, P>;+ fn deref(&self) -> &Self::Target {+ &self.list+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> DerefMut for ListState<S, P> {+ fn deref_mut(&mut self) -> &mut Self::Target {+ &mut self.list+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> Focusable for ListState<S, P> {+ fn focus_handle(&self, _: &App) -> FocusHandle {+ self.focus.clone()+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> ListState<S, P> {+ /// An entity state for `list` (call inside `cx.new`).+ pub fn new(list: List<S, P>, cx: &mut Context<Self>) -> Self {+ Self { list, focus: cx.focus_handle(), text: TextCache::new(TEXT_CACHE_CAPACITY), text_scale: 1.0, last_frame: None }+ }++ /// Called while preparing to paint, with the list's bounds: resize,+ /// advance the smooth scroll, lay the frame out (text widths from the+ /// shaper, cached for the paint that follows) and do idle measuring.+ pub(crate) fn sync(&mut self, bounds: Bounds<Pixels>, window: &mut Window, cx: &mut App) {+ let (w, h) = (f32::from(bounds.size.width), f32::from(bounds.size.height));+ if w < 1.0 || h < 1.0 {+ return;+ }+ let scale = window.scale_factor();+ if (self.text_scale - scale).abs() > f32::EPSILON {+ self.text.clear();+ self.text_scale = scale;+ }+ let (vw, vh) = self.list.view.viewport();+ if (vw - w).abs() > f32::EPSILON || (vh - h).abs() > f32::EPSILON {+ self.list.resize(w, h);+ }+ let now = Instant::now();+ let dt = self.last_frame.replace(now).map_or(1.0 / 60.0, |t| now.duration_since(t).as_secs_f64().min(0.1));+ let mut more = self.list.view.tick(dt);+ self.text.next_generation();+ self.text.ensure_capacity(self.list.view.placed().len() * 6 + 256);+ let font = window.text_style().font();+ let Self { list, text, .. } = self;+ let mut sink = GpuiSink::new(window, cx, bounds.origin, text, &font, list.style.palette().text);+ {+ use blenderui_vlist::PaintSink as _;+ let mut tw = |s: &str, z: f32| sink.text_width(s, z);+ list.layout(&mut tw);+ if !list.view.flinging() {+ more |= list.prefetch(&mut tw, Budget::Time(Duration::from_micros(800)));+ }+ }+ if more {+ window.request_animation_frame();+ } else {+ self.last_frame = None;+ }+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> ListState<S, P> {+ /// Paint the laid-out frame into the window's scene at `origin`.+ pub(crate) fn paint_into(&mut self, window: &mut Window, cx: &mut App, origin: gpui::Point<Pixels>) {+ let font = window.text_style().font();+ let Self { list, text, .. } = self;+ let mut sink = GpuiSink::new(window, cx, origin, text, &font, list.style.palette().text);+ list.paint(&mut sink);+ }+}diff --git a/bindings/rust/blenderui-vlist/Cargo.toml b/bindings/rust/blenderui-vlist/Cargo.tomlnew file mode 100644index 0000000..48cadc5--- /dev/null+++ b/bindings/rust/blenderui-vlist/Cargo.toml@@ -0,0 +1,47 @@+[package]+name = "blenderui-vlist"+description = "Variable-height virtualized list core: one two-level height index for 100 to 10M+ items, anchor-based scrolling, measured wrapping, ItemSource and a chat list"+version.workspace = true+edition.workspace = true+license.workspace = true+repository.workspace = true+homepage.workspace = true+authors.workspace = true+rust-version.workspace = true+documentation = "https://docs.rs/blenderui-vlist"+keywords = ["list", "virtualization", "chat", "gui", "blender"]+categories = ["gui", "data-structures"]+readme = "README.md"+include = ["src/**", "tests/**", "examples/**", "README.md", "Cargo.toml"]+publish = false++[dependencies]+blenderui-paint = { path = "../blenderui-paint", version = "0.2.0" }++[lints.clippy]+all = { level = "warn", priority = -2 }+pedantic = { level = "warn", priority = -2 }+perf = { level = "warn", priority = -1 }+complexity = { level = "warn", priority = -1 }+inline_always = "allow"+unseparated_literal_suffix = "allow"+similar_names = "allow"+missing_panics_doc = "allow"+missing_errors_doc = "allow"+absolute_paths = "allow"+module_name_repetitions = "allow"+doc_markdown = "allow"+too_many_lines = "allow"+unused_self = "allow"+cast_possible_truncation = "allow"+cast_sign_loss = "allow"+cast_precision_loss = "allow"+unreadable_literal = "allow"+implicit_hasher = "allow"+significant_drop_tightening = "warn"+redundant_clone = "warn"+use_self = "warn"+redundant_else = "warn"+or_fun_call = "warn"+missing_const_for_fn = "warn"+derive_partial_eq_without_eq = "warn"diff --git a/bindings/rust/blenderui-vlist/README.md b/bindings/rust/blenderui-vlist/README.mdnew file mode 100644index 0000000..a78aead--- /dev/null+++ b/bindings/rust/blenderui-vlist/README.md@@ -0,0 +1,68 @@+# blenderui-vlist++A variable-height virtualized list core (chat-grade), **one design from 100+items to 10M and beyond**: no small mode and large mode, no state that can+be wrong. `std` only, no dependencies besides [`blenderui-paint`](../blenderui-paint).+Framework adapters hold no list logic: `blenderui`'s `vlist` module+(`variable_list`, `chat_list`) and a gpui adapter.++```text+ ItemSource ---> ListView ---> PaintSink+ (records, index, anchor, (rects, text, clips;+ bytes per one frame the adapter implements it)+ range) ^+ Measurer -----------+ how an item lays out; wrapped lines cached per width+```++## The index++`HeightIndex` groups items in blocks of up to 1024. The top level is a+Fenwick tree over blocks (height and count per node) with spare slots on both+sides, so prepending history is a point update, not a shift. Each block is++* `Uniform`: a count and one height (a 10M-row list of equal rows is a few+ hundred KB of block headers),+* `Estimated`: a count and the text bytes it holds, nothing per item; the+ height comes from an estimator that learns from every real measurement,+* `Measured`: `u32` prefix sums (1/64 px) plus an exactness bit per item.++A list of up to one block is one block and the tree is bypassed. Memory+follows what was scrolled through, not the length; `trim` returns far blocks+to estimates, and a new wrap width demotes every measured block at once.++## Scrolling++The position is an anchor, `(item, offset inside it)`, painted relative to it+in small `f32` coordinates, or `Pos::Bottom` (the end at the bottom edge). A+height changing above the viewport cannot move what the user sees; prepending+a page does not jump; `stick_to_bottom` follows new messages while at the+bottom and stops when the user scrolls up.++## Use++```rust+use blenderui_vlist::{ChatList, Options, synth};+use blenderui_paint::Palette;++let mut chat = ChatList::from_messages(+ synth::messages(0, 1_000_000), Palette::blender_dark(), 600.0, 400.0,+ Options { start_at_end: true, ..Options::default() },+);+let mut tw = |s: &str, size: f32| s.len() as f32 * size * 0.5; // the host's text measurement+chat.layout(&mut tw); // measures what is on screen, within the budget+// chat.paint(&mut my_sink); // my_sink: impl PaintSink+chat.push(synth::message(1_000_000)); // follows, because it was at the bottom+```++For items that are not chat messages, build a `List` from your own+`ItemSource`, `Measurer` and `ItemPainter`.++## Sources++`VecSource` (in memory) and `log::LogSource` (a file-backed append-only log:+fixed 16-byte records plus a text arena, read with positioned reads, so a+10M-message list needs no RAM for the messages and its index is built from+two 8-byte reads per block).++Run `cargo run --release -p blenderui-vlist --example bench_core` for the+index micro-benchmarks and `--example bench_frames` for whole frames.diff --git a/bindings/rust/blenderui-vlist/bench/results.json b/bindings/rust/blenderui-vlist/bench/results.jsonnew file mode 100644index 0000000..1a13a05--- /dev/null+++ b/bindings/rust/blenderui-vlist/bench/results.json@@ -0,0 +1,175 @@+[+ {+ "n": 100,+ "source": "vec",+ "runs": 3,+ "data_ms": 0.048,+ "build_ms": 0.023,+ "data_heap_bytes": 16974,+ "first_us": 50.4,+ "scroll_allocs_per_frame": 0.019,+ "scroll_p50_us": 4,+ "scroll_p95_us": 4.3,+ "scroll_p99_us": 4.9,+ "scroll_max_us": 11.7,+ "scroll_mean_us": 4.083,+ "settled_allocs_per_frame": 0,+ "settled_p50_us": 4,+ "settled_p95_us": 4,+ "settled_p99_us": 4,+ "settled_max_us": 12.8,+ "settled_mean_us": 3.959,+ "jump_p50_us": 3.9,+ "jump_p95_us": 5.8,+ "jump_p99_us": 10.6,+ "jump_max_us": 17,+ "jump_mean_us": 4.078,+ "stream_p50_us": 19.4,+ "stream_p95_us": 36.4,+ "stream_p99_us": 38.9,+ "stream_max_us": 57.4,+ "stream_mean_us": 20.102,+ "measured_items": 100,+ "index_heap_bytes": 756,+ "working_set_mb": 2.055,+ "peak_working_set_mb": 2.055,+ "private_mb": 1.906,+ "live_heap_mb": 1.866+ },+ {+ "n": 10000,+ "source": "vec",+ "runs": 3,+ "data_ms": 4.058,+ "build_ms": 0.35,+ "data_heap_bytes": 1810146,+ "first_us": 47.7,+ "scroll_allocs_per_frame": 2.217,+ "scroll_p50_us": 4.7,+ "scroll_p95_us": 7.9,+ "scroll_p99_us": 10.9,+ "scroll_max_us": 95.6,+ "scroll_mean_us": 5.029,+ "settled_allocs_per_frame": 0,+ "settled_p50_us": 3.5,+ "settled_p95_us": 3.6,+ "settled_p99_us": 4.3,+ "settled_max_us": 7.4,+ "settled_mean_us": 3.529,+ "jump_p50_us": 13.4,+ "jump_p95_us": 27.1,+ "jump_p99_us": 39.9,+ "jump_max_us": 335.7,+ "jump_mean_us": 16.258,+ "stream_p50_us": 19.9,+ "stream_p95_us": 35.1,+ "stream_p99_us": 38.5,+ "stream_max_us": 43.1,+ "stream_mean_us": 19.552,+ "measured_items": 10000,+ "index_heap_bytes": 43168,+ "working_set_mb": 4.953,+ "peak_working_set_mb": 4.953,+ "private_mb": 4.859,+ "live_heap_mb": 4.244+ },+ {+ "n": 1000000,+ "source": "vec",+ "runs": 3,+ "data_ms": 360.873,+ "build_ms": 18.854,+ "data_heap_bytes": 181869186,+ "first_us": 61.1,+ "scroll_allocs_per_frame": 2.213,+ "scroll_p50_us": 4.7,+ "scroll_p95_us": 7.9,+ "scroll_p99_us": 11,+ "scroll_max_us": 111.7,+ "scroll_mean_us": 5.116,+ "settled_allocs_per_frame": 0,+ "settled_p50_us": 3.8,+ "settled_p95_us": 3.9,+ "settled_p99_us": 4.9,+ "settled_max_us": 21,+ "settled_mean_us": 3.815,+ "jump_p50_us": 26.6,+ "jump_p95_us": 34.7,+ "jump_p99_us": 65.8,+ "jump_max_us": 332.8,+ "jump_mean_us": 28.613,+ "stream_p50_us": 19.9,+ "stream_p95_us": 34.5,+ "stream_p99_us": 119.3,+ "stream_max_us": 160.2,+ "stream_mean_us": 20.125,+ "measured_items": 145844,+ "index_heap_bytes": 793364,+ "working_set_mb": 205.078,+ "peak_working_set_mb": 248.129,+ "private_mb": 207.918,+ "live_heap_mb": 184.601+ },+ {+ "n": 1000000,+ "source": "log",+ "runs": 3,+ "data_ms": 0.298,+ "build_ms": 8.337,+ "first_us": 70.6,+ "scroll_allocs_per_frame": 2.214,+ "scroll_p50_us": 4.9,+ "scroll_p95_us": 10.7,+ "scroll_p99_us": 15.2,+ "scroll_max_us": 179,+ "scroll_mean_us": 5.713,+ "settled_allocs_per_frame": 0,+ "settled_p50_us": 4.1,+ "settled_p95_us": 4.1,+ "settled_p99_us": 5.1,+ "settled_max_us": 17.1,+ "settled_mean_us": 4.119,+ "jump_p50_us": 36.7,+ "jump_p95_us": 63.2,+ "jump_p99_us": 93.9,+ "jump_max_us": 553.5,+ "jump_mean_us": 41.506,+ "measured_items": 145844,+ "index_heap_bytes": 793364,+ "working_set_mb": 2.004,+ "peak_working_set_mb": 2.004,+ "private_mb": 1.895,+ "live_heap_mb": 1.403+ },+ {+ "n": 10000000,+ "source": "log",+ "runs": 3,+ "data_ms": 0.333,+ "build_ms": 78.628,+ "first_us": 77.7,+ "scroll_allocs_per_frame": 2.259,+ "scroll_p50_us": 4.8,+ "scroll_p95_us": 12.1,+ "scroll_p99_us": 19,+ "scroll_max_us": 1140.2,+ "scroll_mean_us": 6.527,+ "settled_allocs_per_frame": 0,+ "settled_p50_us": 2.7,+ "settled_p95_us": 2.8,+ "settled_p99_us": 15.5,+ "settled_max_us": 55.9,+ "settled_mean_us": 3.19,+ "jump_p50_us": 35.9,+ "jump_p95_us": 51.1,+ "jump_p99_us": 205.4,+ "jump_max_us": 640.8,+ "jump_mean_us": 40.981,+ "measured_items": 159225,+ "index_heap_bytes": 2432400,+ "working_set_mb": 3.555,+ "peak_working_set_mb": 3.555,+ "private_mb": 3.461,+ "live_heap_mb": 2.984+ }+]\ No newline at end of filediff --git a/bindings/rust/blenderui-vlist/bench/results.md b/bindings/rust/blenderui-vlist/bench/results.mdnew file mode 100644index 0000000..d9d5a44--- /dev/null+++ b/bindings/rust/blenderui-vlist/bench/results.md@@ -0,0 +1,7 @@+| Items | Source | Index build ms | First frame us | Scroll p50 us | p95 | p99 | Settled frame p50 us | Settled allocs | Scroll allocs/frame | Jump p50 us | Stream p50 us | Working set MB |+|---:|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|+| 100 | vec | 0.0 | 50.4 | 4.0 | 4.3 | 4.9 | 4.0 | 0.00 | 0.02 | 3.9 | 19.4 | 2.1 |+| 10,000 | vec | 0.3 | 47.7 | 4.7 | 7.9 | 10.9 | 3.5 | 0.00 | 2.22 | 13.4 | 19.9 | 5.0 |+| 1,000,000 | vec | 18.9 | 61.1 | 4.7 | 7.9 | 11.0 | 3.8 | 0.00 | 2.21 | 26.6 | 19.9 | 205.1 |+| 1,000,000 | log | 8.3 | 70.6 | 4.9 | 10.7 | 15.2 | 4.1 | 0.00 | 2.21 | 36.7 | - | 2.0 |+| 10,000,000 | log | 78.6 | 77.7 | 4.8 | 12.1 | 19.0 | 2.7 | 0.00 | 2.26 | 35.9 | - | 3.6 |diff --git a/bindings/rust/blenderui-vlist/bench/run.mjs b/bindings/rust/blenderui-vlist/bench/run.mjsnew file mode 100644index 0000000..e302b8c--- /dev/null+++ b/bindings/rust/blenderui-vlist/bench/run.mjs@@ -0,0 +1,46 @@+// Runs the core's whole-frame benchmark (examples/bench_frames.rs) three+// times per size and writes the medians to results.json and results.md.+//+// cargo build --release -p blenderui-vlist --example bench_frames -j 1+// node bindings/rust/blenderui-vlist/bench/run.mjs [--reps 3] [--dir <scratch dir for the 10M log>]+//+// 100, 10,000 and 1,000,000 messages come from memory, 10,000,000 from the+// file-backed log (about 1.3 GB on disk, written on first use, kept).++import { spawnSync } from "node:child_process";+import { existsSync, mkdirSync, writeFileSync } from "node:fs";+import { dirname, join } from "node:path";+import { fileURLToPath } from "node:url";++const here = dirname(fileURLToPath(import.meta.url));+const exe = join(here, "..", "..", "target", "release", "examples", process.platform === "win32" ? "bench_frames.exe" : "bench_frames");+if (!existsSync(exe)) throw new Error("build the example first");+const arg = (k, d) => { const i = process.argv.indexOf(k); return i > 0 ? process.argv[i + 1] : d; };+const reps = Number(arg("--reps", 3));+const dir = arg("--dir", join(here, "..", "..", "target", "bench-logs"));+mkdirSync(dir, { recursive: true });++const configs = [[100, "vec"], [10_000, "vec"], [1_000_000, "vec"], [1_000_000, "log"], [10_000_000, "log"]];+const median = (xs) => { const s = [...xs].sort((a, b) => a - b); return s[Math.floor((s.length - 1) / 2)]; };++const results = [];+for (const [n, source] of configs) {+ const runs = [];+ for (let i = 0; i < reps; i++) {+ const r = spawnSync(exe, ["--n", String(n), "--source", source, "--dir", dir], { encoding: "utf8", timeout: 600_000 });+ const line = (r.stdout || "").split("\n").find((l) => l.startsWith("{"));+ if (!line) { console.error(`run failed: ${n} ${source}`, (r.stderr || "").slice(-300)); continue; }+ runs.push(JSON.parse(line));+ }+ if (!runs.length) continue;+ const med = { n, source, runs: runs.length };+ for (const k of Object.keys(runs[0])) if (typeof runs[0][k] === "number" && !(k in med)) med[k] = median(runs.map((r) => r[k]));+ results.push(med);+}+writeFileSync(join(here, "results.json"), JSON.stringify(results, null, 2));++const cols = [["build_ms", "Index build ms"], ["first_us", "First frame us"], ["scroll_p50_us", "Scroll p50 us"], ["scroll_p95_us", "p95"], ["scroll_p99_us", "p99"], ["settled_p50_us", "Settled frame p50 us"], ["settled_allocs_per_frame", "Settled allocs"], ["scroll_allocs_per_frame", "Scroll allocs/frame"], ["jump_p50_us", "Jump p50 us"], ["stream_p50_us", "Stream p50 us"], ["working_set_mb", "Working set MB"]];+let md = `| Items | Source | ${cols.map((c) => c[1]).join(" | ")} |\n|---:|---|${cols.map(() => "---:").join("|")}|\n`;+for (const r of results) md += `| ${r.n.toLocaleString("en-US")} | ${r.source} | ${cols.map(([k]) => (r[k] === undefined ? "-" : r[k].toFixed(k.includes("allocs") ? 2 : 1))).join(" | ")} |\n`;+writeFileSync(join(here, "results.md"), md);+console.log(md);diff --git a/bindings/rust/blenderui-vlist/examples/bench_core.rs b/bindings/rust/blenderui-vlist/examples/bench_core.rsnew file mode 100644index 0000000..38d0b4c--- /dev/null+++ b/bindings/rust/blenderui-vlist/examples/bench_core.rs@@ -0,0 +1,269 @@+//! Micro-benchmarks of the height index against a plain flat prefix-sum+//! `Vec` (the simplest correct implementation) at n = 100, 10k, 1M, 10M.+//!+//! `cargo run --release -p blenderui-vlist --example bench_core`+//!+//! Heap numbers come from a counting global allocator (live bytes), not RSS.+//! Timings are medians of 5 runs of a batch; all inputs are seeded.++#![allow(clippy::many_single_char_names, clippy::too_many_lines, clippy::missing_const_for_fn)]++use std::alloc::{GlobalAlloc, Layout, System};+use std::hint::black_box;+use std::sync::atomic::{AtomicUsize, Ordering::Relaxed};+use std::time::Instant;++use blenderui_paint::testing::Rng;+use blenderui_vlist::{Estimator, Fx, HeightIndex};++struct Tracking;+static LIVE: AtomicUsize = AtomicUsize::new(0);++// SAFETY: forwards to the system allocator, adding relaxed counters.+unsafe impl GlobalAlloc for Tracking {+ unsafe fn alloc(&self, l: Layout) -> *mut u8 {+ LIVE.fetch_add(l.size(), Relaxed);+ unsafe { System.alloc(l) }+ }+ unsafe fn dealloc(&self, p: *mut u8, l: Layout) {+ LIVE.fetch_sub(l.size(), Relaxed);+ unsafe { System.dealloc(p, l) }+ }+ unsafe fn realloc(&self, p: *mut u8, l: Layout, n: usize) -> *mut u8 {+ LIVE.fetch_add(n, Relaxed);+ LIVE.fetch_sub(l.size(), Relaxed);+ unsafe { System.realloc(p, l, n) }+ }+}++#[global_allocator]+static A: Tracking = Tracking;++fn est() -> Estimator {+ Estimator::new(12.0, 19.0, 7.0, 400.0)+}++fn live() -> usize {+ LIVE.load(Relaxed)+}++/// Median over 5 runs of `f`, returning ns per op for `ops` operations per run.+fn ns_per_op(ops: usize, mut f: impl FnMut()) -> f64 {+ let mut runs: Vec<f64> = (0..5)+ .map(|_| {+ let t = Instant::now();+ f();+ t.elapsed().as_nanos() as f64 / ops as f64+ })+ .collect();+ runs.sort_by(f64::total_cmp);+ runs[2]+}++/// The baseline: one flat prefix-sum `Vec`, binary search for lookups, a+/// suffix update for a height change.+struct Flat {+ prefix: Vec<u64>,+}++impl Flat {+ fn new(heights: &[u32]) -> Self {+ let mut prefix = Vec::with_capacity(heights.len() + 1);+ let mut acc = 0u64;+ prefix.push(0);+ for &h in heights {+ acc += u64::from(h);+ prefix.push(acc);+ }+ Self { prefix }+ }+ fn locate(&self, off: u64) -> usize {+ self.prefix.partition_point(|&p| p <= off).saturating_sub(1).min(self.prefix.len() - 2)+ }+ fn append(&mut self, h: u32) {+ let last = self.prefix[self.prefix.len() - 1];+ self.prefix.push(last + u64::from(h));+ }+ fn prepend(&mut self, k: usize, h: u32) {+ let add = k as u64 * u64::from(h);+ let mut p: Vec<u64> = (0..=k).map(|i| i as u64 * u64::from(h)).collect();+ p.pop();+ p.extend(self.prefix.iter().map(|&x| x + add));+ self.prefix = p;+ }+ fn set(&mut self, i: usize, h: u32) {+ let d = u64::from(h).wrapping_sub(self.prefix[i + 1] - self.prefix[i]);+ for p in &mut self.prefix[i + 1..] {+ *p = p.wrapping_add(d);+ }+ }+}++fn heights(n: usize, rng: &mut Rng) -> Vec<u32> {+ (0..n).map(|_| 600 + rng.below(3000) as u32).collect()+}++fn measure_all(idx: &mut HeightIndex, h: &[u32]) {+ for (c, chunk) in h.chunks(1 << 20).enumerate() {+ let mut ups: Vec<(usize, Fx)> = chunk.iter().enumerate().map(|(i, &x)| (c * (1 << 20) + i, Fx::from_units(u64::from(x)))).collect();+ idx.set_heights(&mut ups);+ }+}++fn main() {+ println!("| n | what | HeightIndex | flat Vec prefix sums |");+ println!("|---|---|---|---|");+ for n in [100usize, 10_000, 1_000_000, 10_000_000] {+ let mut rng = Rng::new(n as u64);+ let q = 200_000usize;++ // build estimated, no per-item data (the source answers bytes in O(1))+ let before = live();+ let build = ns_per_op(1, || {+ black_box(HeightIndex::estimated(n, est(), |r| r.len() as u64 * 60).unwrap());+ });+ let idx0 = HeightIndex::estimated(n, est(), |r| r.len() as u64 * 60).unwrap();+ let est_bytes = live() - before;+ println!("| {n} | build, nothing measured | {:.2} ms, {:.3} B/item | n/a (needs every height) |", build / 1e6, est_bytes as f64 / n as f64);++ // queries on the untouched estimate+ let total = idx0.total();+ let offs: Vec<u64> = (0..q).map(|_| rng.below(total)).collect();+ let t = ns_per_op(q, || {+ for &o in &offs {+ black_box(idx0.locate(black_box(o)));+ }+ });+ println!("| {n} | offset -> item, estimated blocks | {t:.0} ns | n/a |");+ drop(idx0);++ // only the tail touched (open at the newest message)+ let h = heights(n, &mut rng);+ let before = live();+ let mut tail = HeightIndex::estimated(n, est(), |r| r.len() as u64 * 60).unwrap();+ let touched = 60.min(n);+ let mut ups: Vec<(usize, Fx)> = (n - touched..n).map(|i| (i, Fx::from_units(u64::from(h[i])))).collect();+ tail.set_heights(&mut ups);+ println!("| {n} | heap after touching only the last {touched} items | {:.3} B/item ({} KB) | n/a (needs all heights) |", (live() - before) as f64 / n as f64, (live() - before) / 1024);+ drop(tail);++ // fully measured+ let before = live();+ let mut idx = HeightIndex::estimated(n, est(), |r| r.len() as u64 * 60).unwrap();+ let t0 = Instant::now();+ measure_all(&mut idx, &h);+ let t_all = t0.elapsed().as_nanos() as f64 / n as f64;+ let idx_bytes = live() - before;+ let flat_before = live();+ let t0 = Instant::now();+ let mut flat = Flat::new(&h);+ let t_flat_build = t0.elapsed().as_nanos() as f64 / n as f64;+ let flat_bytes = live() - flat_before;+ println!("| {n} | build, all measured (per item) | {t_all:.1} ns, {:.2} B/item | {t_flat_build:.1} ns, {:.2} B/item |", idx_bytes as f64 / n as f64, flat_bytes as f64 / n as f64);++ let total = idx.total();+ let offs: Vec<u64> = (0..q).map(|_| rng.below(total)).collect();+ let items: Vec<usize> = (0..q).map(|_| rng.below(n as u64) as usize).collect();+ let a = ns_per_op(q, || {+ for &o in &offs {+ black_box(idx.locate(black_box(o)));+ }+ });+ let b = ns_per_op(q, || {+ for &o in &offs {+ black_box(flat.locate(black_box(o)));+ }+ });+ println!("| {n} | offset -> item (random) | {a:.0} ns | {b:.0} ns |");+ let a = ns_per_op(q, || {+ for &i in &items {+ black_box(idx.offset_of(black_box(i)));+ }+ });+ let b = ns_per_op(q, || {+ for &i in &items {+ black_box(flat.prefix[black_box(i)]);+ }+ });+ println!("| {n} | item -> offset (random) | {a:.0} ns | {b:.1} ns |");++ // a frame's worth: the item at a random offset and the next 30 heights+ let a = ns_per_op(q / 10, || {+ for &o in offs.iter().take(q / 10) {+ let l = idx.locate(black_box(o)).unwrap();+ let mut acc = 0u64;+ let mut k = 0;+ idx.walk_forward(l.item, |_, h, _| {+ acc += u64::from(h.units());+ k += 1;+ k < 30+ });+ black_box(acc);+ }+ });+ let b = ns_per_op(q / 10, || {+ for &o in offs.iter().take(q / 10) {+ let i = flat.locate(black_box(o));+ let end = (i + 30).min(flat.prefix.len() - 1);+ let mut acc = 0u64;+ for w in flat.prefix[i..=end].windows(2) {+ acc += black_box(w[1] - w[0]);+ }+ black_box(acc);+ }+ });+ println!("| {n} | a frame's lookups: locate + walk 30 items | {a:.0} ns | {b:.0} ns |");++ let k = if n >= 10_000_000 { 2_000 } else { 20_000 };+ let a = ns_per_op(k, || {+ for (j, &i) in items.iter().take(k).enumerate() {+ idx.set_height(black_box(i), Fx::from_units(700 + (j % 50) as u64), true);+ }+ });+ let kf = if n >= 1_000_000 { 200 } else { k };+ let b = ns_per_op(kf, || {+ for (j, &i) in items.iter().take(kf).enumerate() {+ flat.set(black_box(i), 700 + (j % 50) as u32);+ }+ });+ println!("| {n} | set one height, random item | {a:.0} ns | {b:.0} ns |");+ let a = ns_per_op(k, || {+ for j in 0..k {+ idx.set_height(n - 1, Fx::from_units(700 + (j % 50) as u64), true);+ }+ });+ let b = ns_per_op(kf, || {+ for j in 0..kf {+ flat.set(n - 1, 700 + (j % 50) as u32);+ }+ });+ println!("| {n} | set the last item (streaming) | {a:.0} ns | {b:.1} ns |");++ // structure: append one, prepend a page+ let a = ns_per_op(10_000, || {+ for _ in 0..10_000 {+ let len = idx.len();+ idx.insert_items(len, 1, 60).unwrap();+ }+ });+ let a2 = ns_per_op(20, || {+ for _ in 0..20 {+ idx.insert_items(0, 500, 500 * 60).unwrap();+ }+ });+ let fa = ns_per_op(10_000, || {+ for _ in 0..10_000 {+ flat.append(700);+ }+ });+ let fp = ns_per_op(if n >= 1_000_000 { 2 } else { 20 }, || {+ for _ in 0..(if n >= 1_000_000 { 2 } else { 20 }) {+ flat.prepend(500, 700);+ }+ });+ println!("| {n} | append 1 item / prepend a 500-item page | {a:.0} ns / {:.1} us | {fa:.0} ns / {:.1} us |", a2 / 1e3, fp / 1e3);+ black_box(&idx);+ black_box(&flat);+ println!("| | | | |");+ }+}diff --git a/bindings/rust/blenderui-vlist/examples/bench_frames.rs b/bindings/rust/blenderui-vlist/examples/bench_frames.rsnew file mode 100644index 0000000..99e2e68--- /dev/null+++ b/bindings/rust/blenderui-vlist/examples/bench_frames.rs@@ -0,0 +1,286 @@+//! Whole-frame cost of the chat list core (layout + paint into a counting+//! sink), one process per configuration, one JSON line out.+//!+//! ```text+//! cargo build --release -p blenderui-vlist --example bench_frames+//! target/release/examples/bench_frames --n 1000000 --source vec+//! target/release/examples/bench_frames --n 10000000 --source log --dir <scratch dir>+//! node blenderui-vlist/bench/run.mjs # 3 runs per size, medians, results.{json,md}+//! ```+//!+//! What is measured (Windows: working set and private bytes come from the+//! process, `measure.rs`; heap bytes from a counting allocator):+//!+//! * `build_ms`: building the source's index (the list's height index over+//! the items, no item touched), `first_ms`: layout + paint of the first+//! frame opened at the newest item, `data_ms`: creating the data.+//! * scroll: 3000 frames of 57 px (3 lines) from the middle: per-frame+//! layout + paint, p50 / p95 / p99 / max, allocations per frame.+//! * jump: 300 jumps to random items (layout + paint of the landing frame).+//! * stream (in-memory sources): the last message grows by a token per+//! frame while pinned to the bottom (edit + layout + paint).+//! * memory after all of it.+//!+//! The text width is a cheap synthetic function (a length times a constant),+//! and the sink only counts calls: this is the list's own cost, without the+//! engine's text shaper or rasterizer. The blenderui and gpui adapters add+//! theirs.++#![allow(clippy::too_many_lines, clippy::type_complexity, clippy::needless_option_as_deref, clippy::useless_format, clippy::map_unwrap_or, clippy::missing_const_for_fn)]++#[allow(clippy::all, clippy::pedantic, clippy::use_self, clippy::missing_const_for_fn, clippy::redundant_clone)]+#[path = "../../bench/common/measure.rs"]+mod measure;++use std::alloc::{GlobalAlloc, Layout, System};+use std::cell::Cell;+use std::hint::black_box;+use std::path::PathBuf;+use std::sync::atomic::{AtomicUsize, Ordering::Relaxed};+use std::time::Instant;++use blenderui_paint::testing::Rng;+use blenderui_paint::{PaintSink, Palette, Rect, Rgba};+use blenderui_vlist::log::{LogSource, LogWriter};+use blenderui_vlist::synth;+use blenderui_vlist::{Align, ChatList, ChatStyle, ItemSource, List, Options, VecSource};++struct Counting;+static LIVE: AtomicUsize = AtomicUsize::new(0);+thread_local! {+ static ALLOCS: Cell<u64> = const { Cell::new(0) };+}++// SAFETY: forwards to the system allocator; counters are a relaxed atomic and a const thread-local.+unsafe impl GlobalAlloc for Counting {+ unsafe fn alloc(&self, l: Layout) -> *mut u8 {+ LIVE.fetch_add(l.size(), Relaxed);+ let _ = ALLOCS.try_with(|c| c.set(c.get() + 1));+ unsafe { System.alloc(l) }+ }+ unsafe fn dealloc(&self, p: *mut u8, l: Layout) {+ LIVE.fetch_sub(l.size(), Relaxed);+ unsafe { System.dealloc(p, l) }+ }+ unsafe fn realloc(&self, p: *mut u8, l: Layout, n: usize) -> *mut u8 {+ LIVE.fetch_add(n, Relaxed);+ LIVE.fetch_sub(l.size(), Relaxed);+ let _ = ALLOCS.try_with(|c| c.set(c.get() + 1));+ unsafe { System.realloc(p, l, n) }+ }+}++#[global_allocator]+static A: Counting = Counting;++fn allocs() -> u64 {+ ALLOCS.with(Cell::get)+}++#[derive(Default)]+struct Null {+ calls: usize,+}++impl PaintSink for Null {+ fn fill(&mut self, _: Rect, _: Rgba) {+ self.calls += 1;+ }+ fn stroke(&mut self, _: Rect, _: Rgba, _: f32) {+ self.calls += 1;+ }+ fn round(&mut self, _: Rect, _: f32, _: Rgba) {+ self.calls += 1;+ }+ fn line(&mut self, _: (f32, f32), _: (f32, f32), _: Rgba, _: f32) {+ self.calls += 1;+ }+ fn text(&mut self, _: f32, _: f32, _: &str, _: f32, _: Rgba) {+ self.calls += 1;+ }+ fn text_width(&mut self, t: &str, size: f32) -> f32 {+ t.len() as f32 * size * 0.5+ }+ fn clipped(&mut self, _: Rect, f: &mut dyn FnMut(&mut dyn PaintSink)) {+ f(self);+ }+}++fn tw(s: &str, size: f32) -> f32 {+ s.len() as f32 * size * 0.5+}++struct Pct {+ p50: f64,+ p95: f64,+ p99: f64,+ max: f64,+ mean: f64,+}++fn pct(mut v: Vec<f64>) -> Pct {+ v.sort_by(f64::total_cmp);+ let at = |q: f64| v[((v.len() as f64 * q) as usize).min(v.len() - 1)];+ Pct { p50: at(0.5), p95: at(0.95), p99: at(0.99), max: v[v.len() - 1], mean: v.iter().sum::<f64>() / v.len() as f64 }+}++fn us(t: Instant) -> f64 {+ t.elapsed().as_secs_f64() * 1e6+}++fn arg(name: &str) -> Option<String> {+ let a: Vec<String> = std::env::args().collect();+ a.iter().position(|x| x == name).and_then(|i| a.get(i + 1)).cloned()+}++fn frame<S: ItemSource>(l: &mut List<S, ChatStyle>, sink: &mut Null) {+ l.layout(&mut tw);+ l.paint(sink);+}++struct Out {+ json: Vec<String>,+ base_ws: usize,+ base_private: usize,+ base_heap: usize,+}++impl Out {+ fn put(&mut self, k: &str, v: f64) {+ self.json.push(format!("\"{k}\":{v:.3}"));+ }+ /// Memory in use now, over the baseline taken before the data existed.+ fn memory(&mut self) {+ let m = measure::memory();+ self.put("working_set_mb", (m.working_set as f64 - self.base_ws as f64) / 1048576.0);+ self.put("peak_working_set_mb", (m.peak_working_set as f64 - self.base_ws as f64) / 1048576.0);+ self.put("private_mb", (m.private_bytes as f64 - self.base_private as f64) / 1048576.0);+ self.put("live_heap_mb", (LIVE.load(Relaxed) as f64 - self.base_heap as f64) / 1048576.0);+ }+ fn pct(&mut self, k: &str, p: &Pct) {+ for (s, v) in [("p50", p.p50), ("p95", p.p95), ("p99", p.p99), ("max", p.max), ("mean", p.mean)] {+ self.put(&format!("{k}_{s}_us"), v);+ }+ }+}++/// The measurement, for any source. `stream` edits the last message (in-memory sources only).+fn run<S: ItemSource>(mut list: List<S, ChatStyle>, n: usize, out: &mut Out, mut stream: Option<&mut dyn FnMut(&mut List<S, ChatStyle>, usize)>) {+ let mut sink = Null::default();+ let t = Instant::now();+ frame(&mut list, &mut sink);+ out.put("first_us", us(t));+ let mut rng = Rng::new(n as u64);++ // scroll from the middle: 3000 frames of three lines+ list.view.jump_to(n / 2, Align::Start);+ for _ in 0..30 {+ frame(&mut list, &mut sink);+ }+ let mut times = Vec::with_capacity(3000);+ let a0 = allocs();+ for _ in 0..3000 {+ let t = Instant::now();+ list.view.scroll_by(57.0);+ frame(&mut list, &mut sink);+ times.push(us(t));+ }+ out.put("scroll_allocs_per_frame", (allocs() - a0) as f64 / 3000.0);+ out.pct("scroll", &pct(times));++ // a settled frame (nothing moved): the cost of a steady frame+ let mut times = Vec::with_capacity(2000);+ let a0 = allocs();+ for _ in 0..2000 {+ let t = Instant::now();+ frame(&mut list, &mut sink);+ times.push(us(t));+ }+ out.put("settled_allocs_per_frame", (allocs() - a0) as f64 / 2000.0);+ out.pct("settled", &pct(times));++ // jumps+ let mut times = Vec::with_capacity(300);+ for _ in 0..300 {+ let item = rng.below(n as u64) as usize;+ let t = Instant::now();+ list.view.jump_to(item, Align::Center);+ frame(&mut list, &mut sink);+ times.push(us(t));+ }+ out.pct("jump", &pct(times));++ // streaming growth of the last message, pinned to the bottom+ if let Some(grow) = stream.as_deref_mut() {+ list.view.scroll_to_end();+ for _ in 0..20 {+ frame(&mut list, &mut sink);+ }+ let mut times = Vec::with_capacity(500);+ for k in 0..500 {+ let t = Instant::now();+ grow(&mut list, k);+ frame(&mut list, &mut sink);+ times.push(us(t));+ }+ out.pct("stream", &pct(times));+ }+ black_box(sink.calls);+ out.put("measured_items", list.view.index().measured_items() as f64);+ out.put("index_heap_bytes", list.view.index().heap_bytes() as f64);+ out.memory();+}++fn main() {+ let n: usize = arg("--n").and_then(|v| v.parse().ok()).expect("--n <items>");+ let source = arg("--source").unwrap_or_else(|| "vec".into());+ let base = measure::memory();+ let mut out = Out { json: vec![format!("\"lib\":\"blenderui-vlist\""), format!("\"n\":{n}"), format!("\"source\":\"{source}\"")], base_ws: base.working_set, base_private: base.private_bytes, base_heap: LIVE.load(Relaxed) };+ let base_heap = out.base_heap;+ let opts = Options { start_at_end: true, ..Options::default() };+ let pal = Palette::blender_dark();++ let t0 = Instant::now();+ if source == "log" {+ let dir = PathBuf::from(arg("--dir").expect("--dir <scratch dir> for the log"));+ std::fs::create_dir_all(&dir).expect("dir");+ let base = dir.join(format!("chat{n}"));+ let have = LogSource::open(&base).map(|s| s.len()).unwrap_or(0);+ if have != n {+ let mut w = LogWriter::create(&base).expect("create log");+ let mut prev = None;+ for i in 0..n as u64 {+ let mut m = synth::message(i);+ m.flags = blenderui_vlist::chat::classify(prev, m.sender, m.time);+ prev = Some((m.sender, m.time));+ w.append(&m).expect("write");+ }+ w.finish().expect("flush");+ }+ out.put("data_ms", t0.elapsed().as_secs_f64() * 1e3);+ let src = LogSource::open(&base).expect("open log");+ let before = (measure::memory(), LIVE.load(Relaxed));+ let t = Instant::now();+ let list = List::new(src, ChatStyle::new(pal), 700.0, 600.0, opts).expect("index");+ out.put("build_ms", t.elapsed().as_secs_f64() * 1e3);+ run(list, n, &mut out, None);+ let _ = before;+ } else {+ let msgs = synth::messages(0, n as u64);+ out.put("data_ms", t0.elapsed().as_secs_f64() * 1e3);+ let before_heap = LIVE.load(Relaxed);+ let t = Instant::now();+ let list = ChatList::from_messages(msgs, pal, 700.0, 600.0, opts);+ out.put("build_ms", t.elapsed().as_secs_f64() * 1e3);+ out.put("data_heap_bytes", (before_heap.saturating_sub(base_heap)) as f64);+ let mut text = String::new();+ let mut grow = |l: &mut ChatList, _k: usize| {+ text.push_str("tokens arrive ");+ let last = l.source.len() - 1;+ l.edit(last, &text);+ };+ run(list, n, &mut out, Some(&mut grow));+ black_box(VecSource::new());+ }+ println!("{{{}}}", out.json.join(","));+}diff --git a/bindings/rust/blenderui-vlist/src/chat.rs b/bindings/rust/blenderui-vlist/src/chat.rsnew file mode 100644index 0000000..a1ff953--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/chat.rs@@ -0,0 +1,274 @@+//! A chat list: [`ChatStyle`] is the [`Measurer`] and [`ItemPainter`] for+//! messages (avatar, name and time on the first message of a run, a date+//! divider on the first of a day, wrapped text, an image placeholder of the+//! height the record carries), and [`ChatList`] owns the messages and the+//! [`ListView`] together so the two cannot disagree about what changed.+//!+//! Neighbour-dependent layout is decided when a message is inserted+//! ([`classify`]) and stored in its flags, so a message's height depends on+//! its own record alone and any message can be measured without its+//! neighbours. Whole-message selection is here; selecting text across+//! messages is not done.++use std::fmt::Write as _;++use blenderui_paint::{PaintSink, Palette, Rect, Rgba};++use crate::estimate::Estimator;+use crate::list::List;+use crate::measure::Measurer;+use crate::scrollbar::WIDTH as SCROLL_W;+use crate::source::{ItemSource, Message, Record, VecSource, FLAG_DIVIDER, FLAG_HEADER};+use crate::view::Options;+use crate::wrap::Lines;+use crate::paint::ItemPainter;++/// Header and divider flags for a message after `prev` (its sender and+/// time; `None` for the first message): a new run starts when the sender+/// changes or after five quiet minutes, a divider when the day changes.+#[must_use]+pub const fn classify(prev: Option<(u16, u32)>, sender: u16, time: u32) -> u8 {+ match prev {+ None => FLAG_HEADER | FLAG_DIVIDER,+ Some((ps, pt)) => {+ let mut f = 0;+ if ps != sender || time.saturating_sub(pt) > 300 {+ f |= FLAG_HEADER;+ }+ if time / 86_400 != pt / 86_400 {+ f |= FLAG_DIVIDER | FLAG_HEADER;+ }+ f+ }+ }+}++/// Year, month, day of a day count since 1970-01-01 (Hinnant's `civil_from_days`).+const fn civil(days: i64) -> (i64, u32, u32) {+ let z = days + 719_468;+ let era = z.div_euclid(146_097);+ let doe = z.rem_euclid(146_097);+ let yoe = (doe - doe / 1460 + doe / 36_524 - doe / 146_096) / 365;+ let doy = doe - (365 * yoe + yoe / 4 - yoe / 100);+ let mp = (5 * doy + 2) / 153;+ let d = (doy - (153 * mp + 2) / 5 + 1) as u32;+ let m = if mp < 10 { mp + 3 } else { mp - 9 } as u32;+ (yoe + era * 400 + (m <= 2) as i64, m, d)+}++/// Sizes and colors of a chat. Metrics in px.+#[derive(Clone, Debug)]+pub struct ChatStyle {+ pub pal: Palette,+ pub font_size: f32,+ pub line_height: f32,+ pub avatar: f32,+ pub pad_x: f32,+ pub header_h: f32,+ pub divider_h: f32,+ /// Id of the selected message.+ pub selected: Option<u64>,+}++impl ChatStyle {+ #[must_use]+ pub const fn new(pal: Palette) -> Self {+ Self { pal, font_size: 14.0, line_height: 19.0, avatar: 32.0, pad_x: 10.0, header_h: 20.0, divider_h: 30.0, selected: None }+ }++ fn text_left(&self) -> f32 {+ self.pad_x + self.avatar + 10.0+ }++ const fn top(&self, rec: &Record<'_>) -> f32 {+ if rec.flags & FLAG_HEADER != 0 { 10.0 } else { 1.0 }+ }++ fn avatar_color(&self, sender: u16) -> Rgba {+ const HUES: [(f32, f32, f32); 8] = [+ (0.30, 0.55, 0.85),+ (0.85, 0.45, 0.30),+ (0.35, 0.70, 0.45),+ (0.75, 0.40, 0.70),+ (0.85, 0.70, 0.30),+ (0.30, 0.70, 0.75),+ (0.70, 0.35, 0.40),+ (0.55, 0.55, 0.85),+ ];+ let (r, g, b) = HUES[usize::from(sender) % HUES.len()];+ Rgba::new(r, g, b, 1.0)+ }+}++impl Measurer for ChatStyle {+ fn font_size(&self) -> f32 {+ self.font_size+ }++ fn line_height(&self) -> f32 {+ self.line_height+ }++ fn wrap_width(&self, _rec: &Record<'_>, list_width: f32) -> f32 {+ (list_width - SCROLL_W - self.text_left() - self.pad_x).max(40.0)+ }++ fn chrome(&self, rec: &Record<'_>) -> f32 {+ let mut h = self.top(rec) + 3.0;+ if rec.flags & FLAG_HEADER != 0 {+ h += self.header_h;+ }+ if rec.flags & FLAG_DIVIDER != 0 {+ h += self.divider_h;+ }+ if rec.media_h > 0 {+ h += f32::from(rec.media_h) + 6.0;+ }+ h+ }++ fn estimator(&self, list_width: f32) -> Estimator {+ // a third of the messages start a run; images are rare+ let pad = f64::from(self.top(&Record { id: 0, time: 0, sender: 0, flags: 0, media_h: 0, text: "" }) + 3.0) + f64::from(self.header_h) * 0.33;+ let w = f64::from(self.wrap_width(&Record { id: 0, time: 0, sender: 0, flags: 0, media_h: 0, text: "" }, list_width));+ Estimator::new(pad, f64::from(self.line_height), f64::from(self.font_size) * 0.5, w)+ }+}++impl ItemPainter for ChatStyle {+ fn palette(&self) -> &Palette {+ &self.pal+ }++ fn item(&self, sink: &mut dyn PaintSink, r: Rect, rec: &Record<'_>, lines: &Lines) {+ let pal = self.pal;+ let mut y = r.y + self.top(rec);+ if self.selected == Some(rec.id) {+ sink.fill(r, pal.sel.opacity(0.35));+ }+ if rec.flags & FLAG_DIVIDER != 0 {+ let cy = y + self.divider_h * 0.5 - 4.0;+ sink.fill(Rect::new(self.pad_x, cy, r.w - SCROLL_W - 2.0 * self.pad_x, 1.0), pal.line);+ let (yy, mm, dd) = civil(i64::from(rec.time / 86_400));+ let mut label = StackStr::default();+ let _ = write!(label, "{yy}-{mm:02}-{dd:02}");+ let tw = sink.text_width(label.as_str(), self.font_size - 1.0);+ let x = (r.w - SCROLL_W - tw) * 0.5;+ sink.fill(Rect::new(x - 8.0, cy - 8.0, tw + 16.0, 17.0), pal.back);+ sink.text(x, cy, label.as_str(), self.font_size - 1.0, pal.dim);+ y += self.divider_h;+ }+ if rec.flags & FLAG_HEADER != 0 {+ let a = self.avatar;+ sink.round(Rect::new(self.pad_x, y, a, a), a * 0.5, self.avatar_color(rec.sender));+ let mut buf = StackStr::default();+ let _ = write!(buf, "{}", char::from(b'A' + (rec.sender % 26) as u8));+ let lw = sink.text_width(buf.as_str(), self.font_size + 1.0);+ sink.text(self.pad_x + (a - lw) * 0.5, y + a * 0.5, buf.as_str(), self.font_size + 1.0, Rgba::new(1.0, 1.0, 1.0, 1.0));+ let mut name = StackStr::default();+ let _ = write!(name, "User {}", rec.sender);+ let nx = self.text_left();+ sink.text(nx, y + self.header_h * 0.5, name.as_str(), self.font_size, self.avatar_color(rec.sender));+ let nw = sink.text_width(name.as_str(), self.font_size);+ let mut at = StackStr::default();+ let s = rec.time % 86_400;+ let _ = write!(at, "{:02}:{:02}", s / 3600, (s / 60) % 60);+ sink.text(nx + nw + 8.0, y + self.header_h * 0.5, at.as_str(), self.font_size - 2.0, pal.dim);+ y += self.header_h;+ }+ let x = self.text_left();+ for i in 0..lines.count() {+ sink.text(x, y + self.line_height * 0.5, lines.line(rec.text, i), self.font_size, pal.text);+ y += self.line_height;+ }+ if rec.media_h > 0 {+ let w = (r.w - SCROLL_W - x - self.pad_x).min(f32::from(rec.media_h) * 1.5);+ sink.round(Rect::new(x, y + 3.0, w, f32::from(rec.media_h)), 4.0, pal.dim.opacity(0.25));+ sink.text(x + 8.0, y + 3.0 + f32::from(rec.media_h) * 0.5, "image", self.font_size - 1.0, pal.dim);+ }+ }++ fn skeleton(&self, sink: &mut dyn PaintSink, r: Rect, rec: Option<&Record<'_>>) {+ let pal = self.pal;+ let y = r.y + rec.map_or(10.0, |rec| self.top(rec));+ let dim = pal.dim.opacity(0.18);+ sink.round(Rect::new(self.pad_x, y, self.avatar, self.avatar), self.avatar * 0.5, dim);+ let x = self.text_left();+ sink.round(Rect::new(x, y + 3.0, 90.0, 10.0), 5.0, dim);+ sink.round(Rect::new(x, y + 20.0, (r.w - x - 40.0).max(20.0) * 0.7, 10.0), 5.0, dim);+ }+}++/// Messages plus a view over them. All changes go through here, so the view+/// always knows what happened.+pub type ChatList = List<VecSource, ChatStyle>;++impl ChatList {+ /// A chat of `messages` (already classified, see [`crate::synth::messages`]).+ #[must_use]+ pub fn from_messages(messages: Vec<Message>, pal: Palette, width: f32, height: f32, opts: Options) -> Self {+ // 2^40 items is far past what a Vec holds+ Self::new(VecSource::from_messages(messages), ChatStyle::new(pal), width, height, opts).expect("a Vec cannot exceed the index capacity")+ }++ /// A new message at the end: its run/day flags are decided now.+ pub fn push(&mut self, mut m: Message) {+ let prev = self.source.len().checked_sub(1).and_then(|i| self.source.get(i)).map(|p| (p.sender, p.time));+ m.flags = classify(prev, m.sender, m.time);+ let bytes = m.text.len() as u64;+ self.source.push(m);+ let _ = self.view.appended(1, bytes);+ }++ /// A page of older messages at the start (classified, oldest first). The+ /// first message that was shown first keeps its flags.+ pub fn prepend(&mut self, older: Vec<Message>) {+ let (n, bytes) = (older.len(), older.iter().map(|m| m.text.len() as u64).sum());+ self.source.prepend(older);+ let _ = self.view.prepended(n, bytes);+ }++ /// Replace message `i`'s text (an edit, a streaming token).+ pub fn edit(&mut self, i: usize, text: &str) {+ let Some(old) = self.source.get(i).map(|m| m.text.len() as u64) else { return };+ self.source.set_text(i, text);+ self.view.edited(i, old, text.len() as u64);+ }++ /// Delete message `i`.+ pub fn remove(&mut self, i: usize) {+ if i < self.source.len() {+ let m = self.source.remove(i);+ self.view.removed(i, 1, m.text.len() as u64);+ }+ }++ /// Select message `item` (deselect it when it is selected already).+ pub fn toggle_selected(&mut self, item: usize) {+ let id = self.source.id_at(item);+ self.style.selected = if self.style.selected == id { None } else { id };+ }++}++/// A small fixed buffer for formatting a label without allocating.+#[derive(Default)]+struct StackStr {+ buf: [u8; 32],+ len: usize,+}++impl std::fmt::Write for StackStr {+ fn write_str(&mut self, s: &str) -> std::fmt::Result {+ let end = self.len + s.len();+ self.buf.get_mut(self.len..end).ok_or(std::fmt::Error)?.copy_from_slice(s.as_bytes());+ self.len = end;+ Ok(())+ }+}++impl StackStr {+ fn as_str(&self) -> &str {+ std::str::from_utf8(&self.buf[..self.len]).unwrap_or("")+ }+}diff --git a/bindings/rust/blenderui-vlist/src/estimate.rs b/bindings/rust/blenderui-vlist/src/estimate.rsnew file mode 100644index 0000000..0792b0e--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/estimate.rs@@ -0,0 +1,107 @@+//! Height estimates for items nobody has measured yet (an *Estimated* block+//! keeps only a count and the text bytes it holds). Blender's text view has+//! no such thing: it wraps every line on the spot and is O(n) for totals+//! (`textview_draw` in `editors/space_info/textview.cc`). Here the estimate+//! is `pad + lines * line_height`, where `lines` comes from the text size+//! and the wrap width, and a calibration factor learned from every real+//! measurement pulls it toward the truth ([`Estimator::observe`]), so the+//! scrollbar converges as the user scrolls.++use crate::fx::{px_to_units, Fx};++/// Below this many samples the calibration is not trusted.+const MIN_SAMPLES: u32 = 24;+/// The calibration changes the index only when it moved this much (relative).+const RECALIBRATE_AT: f64 = 0.04;++/// See the module docs. All sizes in logical px.+#[derive(Copy, Clone, Debug, PartialEq)]+pub struct Estimator {+ /// Fixed height per item (padding, header ...).+ pub pad: f64,+ pub line_height: f64,+ /// Average advance of one text byte.+ pub char_width: f64,+ /// Width text wraps at.+ pub text_width: f64,+ calib: f64,+ applied: f64,+ est_sum: f64,+ real_sum: f64,+ samples: u32,+}++impl Estimator {+ /// A fresh estimator (calibration 1).+ #[must_use]+ pub const fn new(pad: f64, line_height: f64, char_width: f64, text_width: f64) -> Self {+ Self { pad, line_height, char_width, text_width, calib: 1.0, applied: 1.0, est_sum: 0.0, real_sum: 0.0, samples: 0 }+ }++ /// The same estimator at another wrap width, keeping what it learned.+ #[must_use]+ pub const fn with_text_width(mut self, w: f64) -> Self {+ self.text_width = w;+ self+ }++ fn lines_exact(&self, bytes: u64) -> f64 {+ (bytes as f64 * self.char_width / self.text_width.max(1.0)).ceil().max(1.0)+ }++ fn lines_mean(&self, avg_bytes: f64) -> f64 {+ // the mean of a ceiling is about x + 1/2 once x is past one line+ (avg_bytes * self.char_width / self.text_width.max(1.0) + 0.5).max(1.0)+ }++ /// Estimated height of one item with `bytes` of text, before calibration.+ #[must_use]+ pub fn item_raw(&self, bytes: u64) -> f64 {+ self.pad + self.lines_exact(bytes) * self.line_height+ }++ /// Estimated height of one item with `bytes` of text.+ #[must_use]+ pub fn item(&self, bytes: u64) -> Fx {+ Fx::from_px(self.item_raw(bytes) * self.applied)+ }++ /// Estimated height of `n` items holding `bytes` of text together, in+ /// fixed-point units (a block is far taller than one item).+ #[must_use]+ pub fn block(&self, n: u64, bytes: u64) -> u64 {+ if n == 0 {+ return 0;+ }+ let per = self.pad + self.lines_mean(bytes as f64 / n as f64) * self.line_height;+ px_to_units(per * self.applied * n as f64)+ }++ /// Learn from one measured item. Returns whether the calibration changed+ /// enough that every estimated block must be re-summed.+ pub fn observe(&mut self, bytes: u64, real_px: f64) -> bool {+ self.est_sum += self.item_raw(bytes);+ self.real_sum += real_px;+ self.samples = self.samples.saturating_add(1);+ if self.est_sum > 1e9 {+ // forget the oldest half: the estimator follows the text being read now+ self.est_sum *= 0.5;+ self.real_sum *= 0.5;+ }+ if self.samples < MIN_SAMPLES || self.est_sum <= 0.0 {+ return false;+ }+ self.calib = (self.real_sum / self.est_sum).clamp(0.25, 4.0);+ if (self.calib - self.applied).abs() > self.applied * RECALIBRATE_AT {+ self.applied = self.calib;+ return true;+ }+ false+ }++ /// The calibration factor in force.+ #[must_use]+ pub const fn calibration(&self) -> f64 {+ self.applied+ }+}diff --git a/bindings/rust/blenderui-vlist/src/fx.rs b/bindings/rust/blenderui-vlist/src/fx.rsnew file mode 100644index 0000000..2a798f6--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/fx.rs@@ -0,0 +1,62 @@+//! Heights as fixed-point integers: 1/64 px in a `u32`.+//!+//! Absolute offsets are sums of heights, so they are integers too (`u64`,+//! never `f32`: 10M rows of 60 px are 600M px, past where `f32` keeps a+//! pixel). Integers also make the index exact: a height set and read back+//! is the same number, and the sums never drift. An item is clamped to+//! [`Fx::MAX`] px so a block of [`crate::index::MAX_BLOCK`] items cannot+//! overflow its `u32` prefix sums; NaN and negative inputs become 0. This is+//! the validation at the boundary: past `Fx::from_px` every value is legal.++/// Fixed-point units per pixel.+pub const UNITS_PER_PX: f64 = 64.0;++/// A legal item height.+#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]+pub struct Fx(u32);++impl Fx {+ pub const ZERO: Self = Self(0);+ /// The tallest item: 16384 px.+ pub const MAX: Self = Self(16384 * 64);++ /// From pixels: NaN and negative become 0, too tall becomes [`Fx::MAX`].+ #[must_use]+ pub fn from_px(px: f64) -> Self {+ if px.is_nan() || px <= 0.0 {+ return Self::ZERO;+ }+ Self(((px * UNITS_PER_PX).round().min(f64::from(Self::MAX.0))) as u32)+ }++ /// From raw units (clamped).+ #[must_use]+ pub fn from_units(units: u64) -> Self {+ Self(units.min(u64::from(Self::MAX.0)) as u32)+ }++ #[must_use]+ pub const fn units(self) -> u32 {+ self.0+ }++ #[must_use]+ pub fn px(self) -> f64 {+ f64::from(self.0) / UNITS_PER_PX+ }+}++/// Fixed-point units to pixels (offsets and totals).+#[must_use]+pub fn units_to_px(units: u64) -> f64 {+ units as f64 / UNITS_PER_PX+}++/// Pixels to fixed-point units, saturating; NaN and negative are 0.+#[must_use]+pub fn px_to_units(px: f64) -> u64 {+ if px.is_nan() || px <= 0.0 {+ return 0;+ }+ (px * UNITS_PER_PX).round().min(u64::MAX as f64 / 2.0) as u64+}diff --git a/bindings/rust/blenderui-vlist/src/index/block.rs b/bindings/rust/blenderui-vlist/src/index/block.rsnew file mode 100644index 0000000..a8f9fed--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/index/block.rs@@ -0,0 +1,361 @@+//! One block of the height index: up to [`MAX_BLOCK`] consecutive items in+//! one of three representations, cheapest first.+//!+//! * `Uniform`: every item has one height. A list of equal rows costs a+//! count and a height however long it is.+//! * `Estimated`: nothing is known per item, only the item count and the+//! text bytes they hold; the height is [`Estimator::block`]. A block the+//! user never scrolled to stays this size forever (about 40 bytes).+//! * `Measured`: per-item prefix sums (`u32`, 4 bytes per item) plus an+//! exactness bit per item. Offset in block -> item is a binary search,+//! item -> offset a load; a height change adds a delta to a suffix, a+//! loop the compiler vectorizes. It is Blender's `OffsetIndices`+//! (`BLI_offset_indices.hh`) for one block, made updatable.++use crate::estimate::Estimator;+use crate::fx::Fx;++/// The most items a block holds.+pub const MAX_BLOCK: usize = 1024;+/// The size new blocks get.+pub const TARGET_BLOCK: usize = 512;++#[derive(Clone)]+pub struct Block {+ n: u32,+ bytes: u64,+ kind: Kind,+}++#[derive(Clone)]+enum Kind {+ Uniform(Fx),+ Estimated,+ Measured(Measured),+}++/// `prefix[i]` = height of items `..i` (`prefix.len() == n + 1`); bit `i` of+/// `exact` says item `i` was really measured.+#[derive(Clone)]+struct Measured {+ prefix: Vec<u32>,+ exact: Vec<u64>,+}++impl Measured {+ fn from_items(items: impl Iterator<Item = (u32, bool)>, cap: usize) -> Self {+ let mut prefix = Vec::with_capacity(cap + 1);+ let mut exact = Vec::with_capacity(cap.div_ceil(64));+ prefix.push(0);+ let mut acc = 0u32;+ for (i, (h, e)) in items.enumerate() {+ acc += h;+ prefix.push(acc);+ if i % 64 == 0 {+ exact.push(0);+ }+ if e {+ exact[i / 64] |= 1 << (i % 64);+ }+ }+ Self { prefix, exact }+ }++ const fn n(&self) -> usize {+ self.prefix.len() - 1+ }++ fn is_exact(&self, i: usize) -> bool {+ (self.exact[i / 64] >> (i % 64)) & 1 == 1+ }++ fn height(&self, i: usize) -> u32 {+ self.prefix[i + 1] - self.prefix[i]+ }++ fn items(&self) -> impl Iterator<Item = (u32, bool)> + '_ {+ (0..self.n()).map(|i| (self.height(i), self.is_exact(i)))+ }++ fn set_exact(&mut self, i: usize, e: bool) {+ let (w, b) = (i / 64, 1u64 << (i % 64));+ if e {+ self.exact[w] |= b;+ } else {+ self.exact[w] &= !b;+ }+ }++ /// Replace items `at..at + remove` by `count` items from `new`.+ fn splice(&mut self, at: usize, remove: usize, count: usize, new: impl Iterator<Item = (u32, bool)>) {+ let old: Vec<(u32, bool)> = self.items().collect();+ let it = old[..at].iter().copied().chain(new).chain(old[at + remove..].iter().copied());+ *self = Self::from_items(it, old.len() - remove + count);+ }+}++impl Block {+ #[must_use]+ pub const fn uniform(n: u32, h: Fx) -> Self {+ Self { n, bytes: 0, kind: Kind::Uniform(h) }+ }++ #[must_use]+ pub const fn estimated(n: u32, bytes: u64) -> Self {+ Self { n, bytes, kind: Kind::Estimated }+ }++ #[must_use]+ pub const fn n(&self) -> usize {+ self.n as usize+ }++ #[must_use]+ pub const fn bytes(&self) -> u64 {+ self.bytes+ }++ #[must_use]+ pub const fn is_estimated(&self) -> bool {+ matches!(self.kind, Kind::Estimated)+ }++ #[must_use]+ pub const fn is_measured(&self) -> bool {+ matches!(self.kind, Kind::Measured(_))+ }++ /// Total height, fixed-point units.+ #[must_use]+ pub fn height(&self, est: &Estimator) -> u64 {+ match &self.kind {+ Kind::Uniform(h) => u64::from(self.n) * u64::from(h.units()),+ Kind::Estimated => est.block(u64::from(self.n), self.bytes),+ Kind::Measured(m) => u64::from(m.prefix[m.prefix.len() - 1]),+ }+ }++ /// The item height of an estimated block: items `0..n-1` have it, the+ /// last takes the remainder, so the items sum to the block exactly.+ fn avg(&self, est: &Estimator) -> u64 {+ self.height(est) / u64::from(self.n.max(1))+ }++ /// Offsets of item `local`'s top and bottom inside the block.+ #[must_use]+ pub fn item_range(&self, local: usize, est: &Estimator) -> (u64, u64) {+ match &self.kind {+ Kind::Uniform(h) => {+ let h = u64::from(h.units());+ (local as u64 * h, (local as u64 + 1) * h)+ }+ Kind::Measured(m) => (u64::from(m.prefix[local]), u64::from(m.prefix[local + 1])),+ Kind::Estimated => {+ let avg = self.avg(est);+ let end = if local + 1 >= self.n() { self.height(est) } else { (local as u64 + 1) * avg };+ (local as u64 * avg, end)+ }+ }+ }++ #[must_use]+ pub fn item_height(&self, local: usize, est: &Estimator) -> Fx {+ let (a, b) = self.item_range(local, est);+ Fx::from_units(b - a)+ }++ /// Whether item `local`'s height was measured (a uniform block is exact).+ #[must_use]+ pub fn is_exact(&self, local: usize) -> bool {+ match &self.kind {+ Kind::Uniform(_) => true,+ Kind::Estimated => false,+ Kind::Measured(m) => m.is_exact(local),+ }+ }++ /// The item containing offset `rem` in the block, and the offset inside+ /// it (saturating at the last item).+ #[must_use]+ pub fn locate(&self, rem: u64, est: &Estimator) -> (usize, u64) {+ let last = self.n().saturating_sub(1);+ match &self.kind {+ Kind::Uniform(h) => {+ let h = u64::from(h.units()).max(1);+ let l = ((rem / h) as usize).min(last);+ (l, rem - l as u64 * h)+ }+ Kind::Measured(m) => {+ let key = u32::try_from(rem).unwrap_or(u32::MAX);+ let l = m.prefix.partition_point(|&p| p <= key).saturating_sub(1).min(last);+ (l, rem - u64::from(m.prefix[l]))+ }+ Kind::Estimated => {+ let avg = self.avg(est).max(1);+ let l = ((rem / avg) as usize).min(last);+ (l, rem.saturating_sub(l as u64 * avg))+ }+ }+ }++ fn make_measured(&mut self, est: &Estimator) -> &mut Measured {+ if !matches!(self.kind, Kind::Measured(_)) {+ let items: Vec<(u32, bool)> = match self.kind {+ Kind::Uniform(h) => vec![(h.units(), true); self.n()],+ _ => (0..self.n()).map(|l| (self.item_height(l, est).units(), false)).collect(),+ };+ self.kind = Kind::Measured(Measured::from_items(items.into_iter(), self.n()));+ }+ match &mut self.kind {+ Kind::Measured(m) => m,+ _ => unreachable!("just made measured"),+ }+ }++ /// Call `f(local, height, exact)` for items `from..` while it returns true; returns+ /// whether it never said stop. The block's kind is matched once, not per item.+ pub fn walk(&self, from: usize, est: &Estimator, mut f: impl FnMut(usize, Fx, bool) -> bool) -> bool {+ match &self.kind {+ Kind::Uniform(h) => (from..self.n()).all(|l| f(l, *h, true)),+ Kind::Measured(m) => m.prefix[from..].windows(2).enumerate().all(|(k, w)| f(from + k, Fx::from_units(u64::from(w[1] - w[0])), m.is_exact(from + k))),+ Kind::Estimated => (from..self.n()).all(|l| f(l, self.item_height(l, est), false)),+ }+ }++ /// Set item `local`'s height (`exact`: it was measured).+ pub fn set(&mut self, local: usize, h: Fx, exact: bool, est: &Estimator) {+ if let Kind::Uniform(u) = self.kind+ && exact+ && u == h+ {+ return;+ }+ let m = self.make_measured(est);+ let d = h.units().wrapping_sub(m.height(local));+ for p in &mut m.prefix[local + 1..] {+ *p = p.wrapping_add(d);+ }+ m.set_exact(local, exact);+ }++ /// Set many items of this block (`updates` sorted by item, in range,+ /// measured): one pass over the prefix sums however many items change.+ pub fn set_many(&mut self, updates: &[(usize, Fx)], est: &Estimator) {+ let Some(&(first, _)) = updates.first() else { return };+ let m = self.make_measured(est);+ let mut carry = 0u32;+ let mut u = updates.iter().peekable();+ let mut prev = m.prefix[first];+ for i in first..m.n() {+ let next = m.prefix[i + 1];+ let old = next - prev;+ prev = next;+ let mut new = old;+ while let Some(&&(j, h)) = u.peek() {+ if j > i {+ break;+ }+ u.next();+ if j == i {+ m.set_exact(i, true);+ new = h.units();+ }+ }+ carry = carry.wrapping_add(new.wrapping_sub(old));+ m.prefix[i + 1] = next.wrapping_add(carry);+ }+ }++ /// Insert `count` new items before `local`, total text `bytes`; they+ /// are inexact (a uniform block's new items share its height).+ pub fn insert(&mut self, local: usize, count: usize, bytes: u64, est: &Estimator) {+ self.bytes += bytes;+ if let Kind::Measured(m) = &mut self.kind {+ let h = est.item(bytes / count.max(1) as u64).units();+ if local == m.n() {+ let mut acc = m.prefix[m.n()];+ let n = m.n();+ m.exact.resize((n + count).div_ceil(64), 0);+ for _ in 0..count {+ acc += h;+ m.prefix.push(acc);+ }+ } else {+ m.splice(local, 0, count, std::iter::repeat_n((h, false), count));+ }+ }+ self.n += count as u32;+ }++ /// Text bytes of one item went from `old` to `new`.+ pub const fn change_bytes(&mut self, old: u64, new: u64) {+ self.bytes = self.bytes.saturating_sub(old).saturating_add(new);+ }++ /// Remove `count` items at `local`, which held `bytes` of text.+ pub fn remove(&mut self, local: usize, count: usize, bytes: u64) {+ self.bytes = self.bytes.saturating_sub(bytes);+ self.n -= count as u32;+ if let Kind::Measured(m) = &mut self.kind {+ m.splice(local, count, 0, std::iter::empty());+ }+ }++ /// Cut the block at `k`, returning the items from `k` on.+ #[must_use]+ pub fn split_off(&mut self, k: usize) -> Self {+ let right_n = self.n() - k;+ let right_bytes = (u128::from(self.bytes) * right_n as u128 / u128::from(self.n.max(1))) as u64;+ let kind = match &mut self.kind {+ Kind::Uniform(h) => Kind::Uniform(*h),+ Kind::Estimated => Kind::Estimated,+ Kind::Measured(m) => {+ let items: Vec<(u32, bool)> = m.items().collect();+ *m = Measured::from_items(items[..k].iter().copied(), k);+ Kind::Measured(Measured::from_items(items[k..].iter().copied(), right_n))+ }+ };+ self.n = k as u32;+ self.bytes -= right_bytes;+ Self { n: right_n as u32, bytes: right_bytes, kind }+ }++ /// Append `other`'s items when both are the same kind and fit in one block.+ pub fn try_merge(&mut self, other: &Self) -> bool {+ if self.n() + other.n() > MAX_BLOCK {+ return false;+ }+ match (&mut self.kind, &other.kind) {+ (Kind::Uniform(a), Kind::Uniform(b)) if a == b => {}+ (Kind::Estimated, Kind::Estimated) => {}+ (Kind::Measured(a), Kind::Measured(b)) => {+ let items: Vec<(u32, bool)> = a.items().chain(b.items()).collect();+ *a = Measured::from_items(items.into_iter(), self.n as usize + other.n());+ }+ _ => return false,+ }+ self.n += other.n;+ self.bytes += other.bytes;+ true+ }++ /// Forget per-item heights (the wrap width changed): back to an+ /// estimate. Returns whether anything changed. Uniform blocks do not+ /// depend on the width.+ pub fn demote(&mut self) -> bool {+ if matches!(self.kind, Kind::Measured(_)) {+ self.kind = Kind::Estimated;+ return true;+ }+ false+ }++ /// Heap bytes held.+ #[must_use]+ pub const fn heap_bytes(&self) -> usize {+ match &self.kind {+ Kind::Measured(m) => m.prefix.capacity() * 4 + m.exact.capacity() * 8,+ _ => 0,+ }+ }+}diff --git a/bindings/rust/blenderui-vlist/src/index/fenwick.rs b/bindings/rust/blenderui-vlist/src/index/fenwick.rsnew file mode 100644index 0000000..fd66398--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/index/fenwick.rs@@ -0,0 +1,125 @@+//! The top level of the height index: a Fenwick tree over blocks that+//! keeps, per node, the summed height and the summed item count together+//! (one cache line answers both questions). Slots left of the first block+//! and right of the last one are spare and hold zero, so putting a block at+//! either end is a point update, not a shift; the owner rebuilds into a+//! bigger tree (doubling) only when a side is full.+//!+//! Blender has no such tree: its `OffsetIndices` are static prefix sums+//! (`BLI_offset_indices.hh`, `accumulate_counts_to_offsets`) that must be+//! recomputed whole. This is the dynamic version of the same idea, over+//! blocks instead of items, so it stays tiny: about 10k nodes (160 KB) for+//! 10M items.++#[derive(Copy, Clone, Default, Debug)]+pub struct Node {+ pub h: u64,+ pub n: u64,+}++/// Sums over `cap` slots (`cap` a power of two, 1-based nodes).+pub struct Fenwick {+ nodes: Vec<Node>,+ cap: usize,+}++/// What a descent found: the slot, and the sums of every slot before it.+#[derive(Copy, Clone, Debug)]+pub struct Found {+ pub slot: usize,+ pub h_before: u64,+ pub n_before: u64,+}++impl Fenwick {+ /// A tree of `cap` slots (rounded up to a power of two), all zero.+ #[must_use]+ pub fn new(cap: usize) -> Self {+ let cap = cap.max(1).next_power_of_two();+ Self { nodes: vec![Node::default(); cap + 1], cap }+ }++ /// A tree whose slots `first..first + values.len()` hold `values`, built in O(cap).+ #[must_use]+ pub fn from_values(cap: usize, first: usize, values: impl Iterator<Item = Node>) -> Self {+ let mut t = Self::new(cap);+ for (i, v) in values.enumerate() {+ t.nodes[first + i + 1] = v;+ }+ for i in 1..=t.cap {+ let j = i + (i & i.wrapping_neg());+ if j <= t.cap {+ let c = t.nodes[i];+ t.nodes[j].h += c.h;+ t.nodes[j].n += c.n;+ }+ }+ t+ }++ #[must_use]+ pub const fn capacity(&self) -> usize {+ self.cap+ }++ #[must_use]+ pub const fn heap_bytes(&self) -> usize {+ self.nodes.capacity() * size_of::<Node>()+ }++ /// Add a signed delta to slot `slot`.+ pub fn add(&mut self, slot: usize, dh: i64, dn: i64) {+ let mut i = slot + 1;+ while i <= self.cap {+ let n = &mut self.nodes[i];+ n.h = n.h.wrapping_add_signed(dh);+ n.n = n.n.wrapping_add_signed(dn);+ i += i & i.wrapping_neg();+ }+ }++ /// Sums over slots `0..slot`.+ #[must_use]+ pub fn prefix(&self, slot: usize) -> Node {+ let (mut i, mut s) = (slot.min(self.cap), Node::default());+ while i > 0 {+ s.h += self.nodes[i].h;+ s.n += self.nodes[i].n;+ i &= i - 1;+ }+ s+ }++ /// The slot whose height range contains `target` (the first slot whose+ /// running height exceeds it; `cap` when `target` is past the total).+ #[must_use]+ pub fn find_by_height(&self, target: u64) -> Found {+ self.descend(target, |n| n.h)+ }++ /// The slot holding item number `target`.+ #[must_use]+ pub fn find_by_count(&self, target: u64) -> Found {+ self.descend(target, |n| n.n)+ }++ fn descend(&self, mut target: u64, key: impl Fn(&Node) -> u64) -> Found {+ let (mut pos, mut hb, mut nb) = (0usize, 0u64, 0u64);+ let mut step = self.cap;+ while step > 0 {+ let next = pos + step;+ if next <= self.cap {+ let n = &self.nodes[next];+ let k = key(n);+ if k <= target {+ target -= k;+ pos = next;+ hb += n.h;+ nb += n.n;+ }+ }+ step >>= 1;+ }+ Found { slot: pos, h_before: hb, n_before: nb }+ }+}diff --git a/bindings/rust/blenderui-vlist/src/index/mod.rs b/bindings/rust/blenderui-vlist/src/index/mod.rsnew file mode 100644index 0000000..c4ab3cb--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/index/mod.rs@@ -0,0 +1,549 @@+//! [`HeightIndex`]: one structure for every list size.+//!+//! Items are grouped in blocks of up to [`MAX_BLOCK`]. The top level is a+//! Fenwick tree over blocks ([`fenwick`]) with spare slots on both sides, the+//! bottom level is per-block ([`block`]): a block is `Uniform`, `Estimated`+//! (a count and a byte total) or `Measured` (prefix sums). A list of up to+//! one block is a single block and the tree is bypassed: effectively a flat+//! array. A list of 10M items is about 20k blocks, a 320 KB tree, and the+//! blocks nobody scrolled to stay estimates, so memory follows what was+//! looked at, not the length.+//!+//! The cost model:+//!+//! | operation | cost |+//! |---|---|+//! | offset -> item, item -> offset | O(log blocks) + a binary search in one block |+//! | set one height | O(log blocks) + a suffix add in one block |+//! | `set_heights` (k at once) | one pass per touched block |+//! | append / prepend items | amortized O(1) per block, no shifting (spare slots) |+//! | insert / remove in the middle | one block, plus a tree rebuild when blocks change |+//! | new wrap width | O(blocks): measured blocks forget per-item heights |+//!+//! Blender keeps nothing like it: `textview_draw` walks and wraps lines+//! (`space_info/textview.cc`), `OffsetIndices` are static prefix sums+//! (`BLI_offset_indices.hh`).++pub mod block;+pub mod fenwick;++use std::collections::VecDeque;++use block::{Block, MAX_BLOCK, TARGET_BLOCK};+use fenwick::{Fenwick, Node};++use crate::estimate::Estimator;+use crate::fx::Fx;++/// The most items an index holds (hostile counts are refused, not wrapped).+pub const MAX_ITEMS: usize = 1 << 40;++/// Why an edit was refused.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub enum IndexError {+ /// More than [`MAX_ITEMS`] items.+ TooManyItems,+ /// A position past the end.+ OutOfRange,+}++/// Where an offset falls.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub struct Located {+ pub item: usize,+ /// Offset inside the item, fixed-point units.+ pub within: u64,+}++/// See the module docs.+pub struct HeightIndex {+ blocks: VecDeque<Block>,+ tree: Fenwick,+ /// Slot of the first block.+ first: usize,+ len: usize,+ total: u64,+ est: Estimator,+}++fn node(b: &Block, est: &Estimator) -> Node {+ Node { h: b.height(est), n: b.n() as u64 }+}++impl HeightIndex {+ /// An empty index.+ #[must_use]+ pub fn new(est: Estimator) -> Self {+ let mut s = Self { blocks: VecDeque::new(), tree: Fenwick::new(4), first: 0, len: 0, total: 0, est };+ s.rebuild_tree();+ s+ }++ /// `n` items of the same height `h`: a handful of blocks, however big `n`.+ pub fn uniform(n: usize, h: Fx, est: Estimator) -> Result<Self, IndexError> {+ Self::from_chunks(n, est, |size, _| Block::uniform(size as u32, h))+ }++ /// `n` items, nothing measured; `bytes_of(range)` is the text bytes in+ /// an item range (O(1) for a source with an offsets table).+ pub fn estimated(n: usize, est: Estimator, mut bytes_of: impl FnMut(std::ops::Range<usize>) -> u64) -> Result<Self, IndexError> {+ Self::from_chunks(n, est, |size, start| Block::estimated(size as u32, bytes_of(start..start + size)))+ }++ fn from_chunks(n: usize, est: Estimator, mut make: impl FnMut(usize, usize) -> Block) -> Result<Self, IndexError> {+ if n > MAX_ITEMS {+ return Err(IndexError::TooManyItems);+ }+ let mut s = Self::new(est);+ s.blocks.reserve(n.div_ceil(TARGET_BLOCK));+ let (mut start, k) = (0, n.div_ceil(TARGET_BLOCK));+ for i in 0..k {+ let size = n / k + usize::from(i < n % k);+ s.blocks.push_back(make(size, start));+ start += size;+ }+ s.rebuild_tree();+ Ok(s)+ }++ #[must_use]+ pub const fn len(&self) -> usize {+ self.len+ }++ #[must_use]+ pub const fn is_empty(&self) -> bool {+ self.len == 0+ }++ /// Total height, fixed-point units.+ #[must_use]+ pub const fn total(&self) -> u64 {+ self.total+ }++ #[must_use]+ pub const fn estimator(&self) -> &Estimator {+ &self.est+ }++ #[must_use]+ pub fn block_count(&self) -> usize {+ self.blocks.len()+ }++ /// Heap bytes the index holds.+ #[must_use]+ pub fn heap_bytes(&self) -> usize {+ self.tree.heap_bytes() + self.blocks.capacity() * size_of::<Block>() + self.blocks.iter().map(Block::heap_bytes).sum::<usize>()+ }++ /// Items whose heights are stored one by one.+ #[must_use]+ pub fn measured_items(&self) -> usize {+ self.blocks.iter().filter(|b| b.is_measured()).map(Block::n).sum()+ }++ // -- the two levels -------------------------------------------------------------------------------------++ /// Re-sum everything from the blocks (a structural change, a new estimator).+ fn rebuild_tree(&mut self) {+ let nb = self.blocks.len();+ // at least a spare slot each side, and about a quarter of the blocks spare each side+ let cap = (nb + nb / 2).max(nb + 2).next_power_of_two();+ self.first = (cap - nb) / 2;+ let est = self.est;+ self.tree = Fenwick::from_values(cap, self.first, self.blocks.iter().map(|b| node(b, &est)));+ self.len = self.blocks.iter().map(Block::n).sum();+ self.total = self.blocks.iter().map(|b| b.height(&est)).sum();+ }++ /// Make a spare slot on one side (the tree doubles when the side is full).+ fn ensure_room(&mut self, back: bool) {+ let full = if back { self.first + self.blocks.len() >= self.tree.capacity() } else { self.first == 0 };+ if full {+ self.rebuild_tree();+ }+ }++ /// Change block `bi` with `f`, and carry the change of its height and+ /// count up the tree.+ fn update_block(&mut self, bi: usize, f: impl FnOnce(&mut Block, &Estimator)) {+ let est = &self.est;+ let b = &mut self.blocks[bi];+ let (oh, on) = (b.height(est), b.n());+ f(b, est);+ let (nh, nn) = (b.height(est), b.n());+ let (dh, dn) = (nh.wrapping_sub(oh) as i64, nn as i64 - on as i64);+ self.tree.add(self.first + bi, dh, dn);+ self.total = self.total.wrapping_add_signed(dh);+ self.len = (self.len as i64 + dn) as usize;+ }++ /// The block holding `item` (`item < len`), the height before it and+ /// the items before it.+ fn find_item(&self, item: usize) -> (usize, u64, usize) {+ if self.blocks.len() == 1 {+ return (0, 0, 0);+ }+ let f = self.tree.find_by_count(item as u64);+ let bi = f.slot.saturating_sub(self.first).min(self.blocks.len() - 1);+ (bi, f.h_before, f.n_before as usize)+ }++ // -- queries --------------------------------------------------------------------------------------------++ /// The item at offset `off` (saturating at the last item); `None` when empty.+ #[must_use]+ pub fn locate(&self, off: u64) -> Option<Located> {+ if self.len == 0 {+ return None;+ }+ let (bi, hb, nb) = if self.blocks.len() == 1 {+ (0, 0, 0)+ } else {+ let f = self.tree.find_by_height(off);+ let bi = f.slot.saturating_sub(self.first).min(self.blocks.len() - 1);+ // past the end lands on the last slot: its before-sums are the totals+ if f.slot >= self.first + self.blocks.len() {+ let last = self.blocks.len() - 1;+ let b = &self.blocks[last];+ let before = self.total - b.height(&self.est);+ let (l, within) = b.locate(off - before, &self.est);+ return Some(Located { item: self.len - b.n() + l, within });+ }+ (bi, f.h_before, f.n_before as usize)+ };+ let (l, within) = self.blocks[bi].locate(off - hb, &self.est);+ Some(Located { item: nb + l, within })+ }++ /// Offset of `item`'s top (`len` gives the total).+ #[must_use]+ pub fn offset_of(&self, item: usize) -> u64 {+ if item >= self.len {+ return self.total;+ }+ let (bi, hb, nb) = self.find_item(item);+ hb + self.blocks[bi].item_range(item - nb, &self.est).0+ }++ /// `item`'s height and whether it was measured.+ #[must_use]+ pub fn height_of(&self, item: usize) -> Option<(Fx, bool)> {+ if item >= self.len {+ return None;+ }+ let (bi, _, nb) = self.find_item(item);+ let b = &self.blocks[bi];+ Some((b.item_height(item - nb, &self.est), b.is_exact(item - nb)))+ }++ /// The item range of the block holding `item`, and whether it is an+ /// estimate (the view materializes the blocks it looks at).+ #[must_use]+ pub fn block_span(&self, item: usize) -> Option<(std::ops::Range<usize>, bool)> {+ if item >= self.len {+ return None;+ }+ let (bi, _, nb) = self.find_item(item);+ let b = &self.blocks[bi];+ Some((nb..nb + b.n(), b.is_estimated()))+ }++ /// Call `f(item, height, exact)` for `from`, `from + 1` ... until it+ /// returns false or the end. One tree lookup, then block by block.+ pub fn walk_forward(&self, from: usize, mut f: impl FnMut(usize, Fx, bool) -> bool) {+ if from >= self.len {+ return;+ }+ let (mut bi, _, mut nb) = self.find_item(from);+ let mut local = from - nb;+ while bi < self.blocks.len() {+ let b = &self.blocks[bi];+ if !b.walk(local, &self.est, |l, h, e| f(nb + l, h, e)) {+ return;+ }+ nb += b.n();+ bi += 1;+ local = 0;+ }+ }++ /// Like [`Self::walk_forward`], towards item 0, starting at `from` (inclusive).+ pub fn walk_backward(&self, from: usize, mut f: impl FnMut(usize, Fx, bool) -> bool) {+ if self.len == 0 {+ return;+ }+ let from = from.min(self.len - 1);+ let (mut bi, _, nb) = self.find_item(from);+ let mut start = nb;+ let mut local = from - nb;+ loop {+ let b = &self.blocks[bi];+ for l in (0..=local).rev() {+ if !f(start + l, b.item_height(l, &self.est), b.is_exact(l)) {+ return;+ }+ }+ if bi == 0 {+ return;+ }+ bi -= 1;+ start -= self.blocks[bi].n();+ local = self.blocks[bi].n() - 1;+ }+ }++ // -- height updates -------------------------------------------------------------------------------------++ /// Set `item`'s height (`exact`: it was measured). Returns whether `item` exists.+ pub fn set_height(&mut self, item: usize, h: Fx, exact: bool) -> bool {+ if item >= self.len {+ return false;+ }+ let (bi, _, nb) = self.find_item(item);+ self.update_block(bi, |b, est| b.set(item - nb, h, exact, est));+ true+ }++ /// Set many measured heights at once (any order, duplicates: the last+ /// wins; items past the end are ignored). Each touched block is updated+ /// in one pass, and the tree is rebuilt instead of patched when that is+ /// cheaper than one point update per block.+ pub fn set_heights(&mut self, updates: &mut [(usize, Fx)]) {+ updates.sort_by_key(|u| u.0);+ let end = updates.partition_point(|u| u.0 < self.len);+ let updates = &mut updates[..end];+ let mut i = 0;+ let mut touched = 0usize;+ let mut patched = Vec::new();+ while i < updates.len() {+ let (bi, _, nb) = self.find_item(updates[i].0);+ let stop = nb + self.blocks[bi].n();+ let j = i + updates[i..].partition_point(|u| u.0 < stop);+ for u in &mut updates[i..j] {+ u.0 -= nb;+ }+ let est = self.est;+ let slice = &updates[i..j];+ let b = &mut self.blocks[bi];+ let oh = b.height(&est);+ b.set_many(slice, &est);+ patched.push((bi, b.height(&est).wrapping_sub(oh) as i64));+ touched += 1;+ i = j;+ }+ let log = self.tree.capacity().trailing_zeros() as usize + 1;+ if touched * log > self.tree.capacity() {+ self.rebuild_tree();+ } else {+ for (bi, dh) in patched {+ self.tree.add(self.first + bi, dh, 0);+ self.total = self.total.wrapping_add_signed(dh);+ }+ }+ }++ /// Item `item` held `old` bytes of text and now holds `new`: only the+ /// aggregate of an estimated block changes.+ pub fn change_bytes(&mut self, item: usize, old: u64, new: u64) {+ if item >= self.len {+ return;+ }+ let (bi, _, _) = self.find_item(item);+ self.update_block(bi, |b, _| b.change_bytes(old, new));+ }++ /// Learn from a measurement of an item with `bytes` of text: when the+ /// estimate's calibration moved, every estimated block is re-summed.+ pub fn observe(&mut self, bytes: u64, real_px: f64) {+ if self.est.observe(bytes, real_px) {+ self.rebuild_tree();+ }+ }++ /// A new estimator (a new wrap width): measured blocks forget their+ /// per-item heights (they are for another width) and become estimates+ /// again, so memory is also released. Uniform blocks stay.+ pub fn set_estimator(&mut self, est: Estimator) {+ self.est = est;+ for b in &mut self.blocks {+ b.demote();+ }+ self.rebuild_tree();+ }++ /// Keep at most `max_items` items measured: the measured blocks farthest+ /// from `center` become estimates again. Memory is bounded by what was+ /// looked at *recently*, not by everything ever scrolled through.+ pub fn trim(&mut self, center: usize, max_items: usize) {+ let mut measured = self.measured_items();+ if measured <= max_items {+ return;+ }+ let mut far = Vec::new();+ let mut start = 0;+ for (bi, b) in self.blocks.iter().enumerate() {+ if b.is_measured() {+ let mid = start + b.n() / 2;+ far.push((mid.abs_diff(center), bi));+ }+ start += b.n();+ }+ far.sort_unstable_by(|a, b| b.cmp(a));+ for (_, bi) in far {+ if measured <= max_items {+ break;+ }+ measured -= self.blocks[bi].n();+ self.blocks[bi].demote();+ }+ self.rebuild_tree();+ }++ // -- structure ------------------------------------------------------------------------------------------++ /// Insert `count` items before item `at` (`at == len` appends, `at == 0`+ /// prepends) holding `bytes` of text. They are inexact. At either end+ /// this adds blocks without moving anything; a hostile count is refused.+ pub fn insert_items(&mut self, at: usize, count: usize, bytes: u64) -> Result<(), IndexError> {+ if count == 0 {+ return Ok(());+ }+ if at > self.len {+ return Err(IndexError::OutOfRange);+ }+ if self.len.checked_add(count).is_none_or(|t| t > MAX_ITEMS) {+ return Err(IndexError::TooManyItems);+ }+ if self.blocks.is_empty() {+ self.insert_chunks(0, count, bytes);+ return Ok(());+ }+ let (bi, local) = if at == self.len {+ (self.blocks.len() - 1, self.blocks[self.blocks.len() - 1].n())+ } else {+ let (bi, _, nb) = self.find_item(at);+ (bi, at - nb)+ };+ let n = self.blocks[bi].n();+ if count <= MAX_BLOCK - n {+ self.update_block(bi, |b, est| b.insert(local, count, bytes, est));+ } else if local == 0 {+ self.insert_chunks(bi, count, bytes);+ } else if local == n {+ self.insert_chunks(bi + 1, count, bytes);+ } else {+ let right = self.blocks[bi].split_off(local);+ self.blocks.insert(bi + 1, right);+ self.insert_chunks(bi + 1, count, bytes);+ }+ Ok(())+ }++ /// New estimated blocks before block position `pos`.+ fn insert_chunks(&mut self, pos: usize, count: usize, bytes: u64) {+ let k = count.div_ceil(TARGET_BLOCK);+ let (mut left, mut bytes_left) = (count, bytes);+ let mut chunks = Vec::with_capacity(k);+ for i in 0..k {+ let size = if i + 1 == k { left } else { count / k + usize::from(i < count % k) };+ let b = if i + 1 == k { bytes_left } else { (u128::from(bytes) * size as u128 / count as u128) as u64 };+ chunks.push(Block::estimated(size as u32, b));+ left -= size;+ bytes_left -= b;+ }+ let est = self.est;+ if pos == self.blocks.len() {+ for b in chunks {+ self.ensure_room(true);+ let nd = node(&b, &est);+ self.tree.add(self.first + self.blocks.len(), nd.h as i64, nd.n as i64);+ self.total += nd.h;+ self.len += nd.n as usize;+ self.blocks.push_back(b);+ }+ } else if pos == 0 {+ for b in chunks.into_iter().rev() {+ self.ensure_room(false);+ self.first -= 1;+ let nd = node(&b, &est);+ self.tree.add(self.first, nd.h as i64, nd.n as i64);+ self.total += nd.h;+ self.len += nd.n as usize;+ self.blocks.push_front(b);+ }+ } else {+ for (i, b) in chunks.into_iter().enumerate() {+ self.blocks.insert(pos + i, b);+ }+ self.rebuild_tree();+ }+ }++ /// Remove `count` items at `at` (clamped to the end) that held `bytes`+ /// of text. Returns how many went. Emptied blocks are dropped and small+ /// neighbours merged.+ pub fn remove_items(&mut self, at: usize, count: usize, bytes: u64) -> usize {+ if at >= self.len {+ return 0;+ }+ let count = count.min(self.len - at);+ let (mut remaining, mut bytes_left) = (count, bytes);+ while remaining > 0 {+ let (bi, _, nb) = self.find_item(at);+ let local = at - nb;+ let take = remaining.min(self.blocks[bi].n() - local);+ let part = if take == remaining { bytes_left } else { (u128::from(bytes_left) * take as u128 / remaining as u128) as u64 };+ self.update_block(bi, |b, _| b.remove(local, take, part));+ remaining -= take;+ bytes_left -= part;+ if self.blocks[bi].n() == 0 {+ // an empty block is skipped by the tree; drop it now so the next lookup is clean+ self.blocks.remove(bi);+ self.rebuild_tree();+ }+ }+ self.merge_small();+ count+ }++ /// Merge neighbouring blocks that are small and of the same kind.+ fn merge_small(&mut self) {+ let small = TARGET_BLOCK / 4;+ if !self.blocks.iter().any(|b| b.n() < small) || self.blocks.len() < 2 {+ return;+ }+ let mut out: VecDeque<Block> = VecDeque::with_capacity(self.blocks.len());+ for b in self.blocks.drain(..) {+ let merged = out.back_mut().is_some_and(|last| (last.n() < small || b.n() < small) && last.try_merge(&b));+ if !merged {+ out.push_back(b);+ }+ }+ self.blocks = out;+ self.rebuild_tree();+ }++ /// Check the invariants (tests): the tree equals the blocks.+ #[doc(hidden)]+ pub fn check(&self) {+ let est = &self.est;+ let mut acc = Node::default();+ for (i, b) in self.blocks.iter().enumerate() {+ let p = self.tree.prefix(self.first + i);+ assert_eq!((p.h, p.n), (acc.h, acc.n), "tree prefix at block {i}");+ acc.h += b.height(est);+ acc.n += b.n() as u64;+ assert!(b.n() > 0 && b.n() <= MAX_BLOCK, "block {i} has {} items", b.n());+ }+ assert_eq!(acc.h, self.total);+ assert_eq!(acc.n as usize, self.len);+ let all = self.tree.prefix(self.tree.capacity());+ assert_eq!((all.h, all.n), (acc.h, acc.n), "tree total");+ }+}++#[cfg(test)]+mod tests;diff --git a/bindings/rust/blenderui-vlist/src/index/tests.rs b/bindings/rust/blenderui-vlist/src/index/tests.rsnew file mode 100644index 0000000..c7f4c88--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/index/tests.rs@@ -0,0 +1,249 @@+//! Randomized tests of the index against a model: a `Vec<Option<u32>>` of+//! the heights the test set (`None`: the index estimates). Every item the+//! model knows must read back exactly, and the index must be consistent+//! with itself for all the others: offsets are the running sums of+//! heights, `locate` inverts `offset_of`, totals add up.++use super::*;+use blenderui_paint::testing::Rng;++fn est() -> Estimator {+ Estimator::new(12.0, 19.0, 7.0, 400.0)+}++fn fx(rng: &mut Rng) -> Fx {+ Fx::from_units(1 + rng.below(40 * 64))+}++fn verify(idx: &HeightIndex, model: &[Option<u32>], rng: &mut Rng) {+ idx.check();+ assert_eq!(idx.len(), model.len());+ let n = idx.len();+ let full = n <= 5000;+ let mut run = 0u64;+ let samples: Vec<usize> = if full { (0..n).collect() } else { (0..300).map(|_| rng.below(n as u64) as usize).chain([0, n - 1]).collect() };+ for &i in &samples {+ let (h, exact) = idx.height_of(i).unwrap();+ if let Some(m) = model[i] {+ assert_eq!((h.units(), exact), (m, true), "item {i}");+ }+ assert!(h.units() > 0);+ let off = idx.offset_of(i);+ if full {+ assert_eq!(off, run, "offset of {i}");+ run += u64::from(h.units());+ }+ // consecutive offsets differ by the height+ assert_eq!(idx.offset_of(i + 1) - off, u64::from(h.units()), "span of {i}");+ // locate inverts offset_of, inside and at the top of the item+ let l = idx.locate(off).unwrap();+ assert_eq!((l.item, l.within), (i, 0), "locate top of {i}");+ let mid = u64::from(h.units()) / 2;+ let l = idx.locate(off + mid).unwrap();+ assert_eq!((l.item, l.within), (i, mid), "locate mid of {i}");+ }+ if full {+ assert_eq!(run, idx.total());+ }+ assert_eq!(idx.offset_of(n), idx.total());+ if n > 0 {+ assert_eq!(idx.locate(u64::MAX / 4).unwrap().item, n - 1);+ } else {+ assert!(idx.locate(0).is_none());+ }+}++fn run(n: usize, ops: usize, seed: u64, uniform_start: bool) {+ let mut rng = Rng::new(seed);+ let mut idx = if uniform_start {+ HeightIndex::uniform(n, Fx::from_px(20.0), est()).unwrap()+ } else {+ HeightIndex::estimated(n, est(), |r| r.len() as u64 * 60).unwrap()+ };+ let mut model: Vec<Option<u32>> = vec![if uniform_start { Some(Fx::from_px(20.0).units()) } else { None }; n];+ verify(&idx, &model, &mut rng);+ for op in 0..ops {+ let len = model.len();+ let which = rng.below(9);+ match which {+ 0 | 1 if len > 0 => {+ let i = rng.below(len as u64) as usize;+ let h = fx(&mut rng);+ assert!(idx.set_height(i, h, true));+ model[i] = Some(h.units());+ }+ 2 if len > 0 => {+ let k = 1 + rng.below(40) as usize;+ let mut ups: Vec<(usize, Fx)> = (0..k).map(|_| (rng.below(len as u64) as usize, fx(&mut rng))).collect();+ // duplicates: the last wins+ let mut last = std::collections::HashMap::new();+ for &(i, h) in &ups {+ last.insert(i, h);+ }+ for (&i, &h) in &last {+ model[i] = Some(h.units());+ }+ idx.set_heights(&mut ups);+ }+ 3 => {+ // append or prepend (one item or a page), or insert in the middle+ let at = match rng.below(3) {+ 0 => len,+ 1 => 0,+ _ => rng.below(len as u64 + 1) as usize,+ };+ let count = if rng.below(8) == 0 { 1 + rng.below(1800) as usize } else { 1 + rng.below(5) as usize };+ idx.insert_items(at, count, count as u64 * 50).unwrap();+ model.splice(at..at, std::iter::repeat_n(None, count));+ }+ 4 if len > 0 => {+ let at = rng.below(len as u64) as usize;+ let big = rng.below(6) == 0;+ let count = 1 + rng.below(if big { 1500 } else { 4 }) as usize;+ let removed = idx.remove_items(at, count, count as u64 * 50);+ model.drain(at..at + removed);+ }+ 5 if !uniform_start => {+ let w = 200.0 + rng.below(600) as f64;+ idx.set_estimator(est().with_text_width(w));+ model.iter_mut().for_each(|m| *m = None);+ }+ 6 if len > 0 && !uniform_start => {+ idx.trim(rng.below(len as u64) as usize, 600);+ // trimmed blocks forget their heights: only what the index still reports exact counts+ for (i, m) in model.iter_mut().enumerate() {+ if m.is_some() && !idx.height_of(i).unwrap().1 {+ *m = None;+ }+ }+ }+ 7 => idx.observe(rng.below(400), 20.0 + rng.below(100) as f64),+ _ => {}+ }+ // observe may re-sum estimates, which cannot change known heights+ if op % 5 == 0 || len < 3000 {+ verify(&idx, &model, &mut rng);+ }+ }+ verify(&idx, &model, &mut rng);+}++#[test]+fn matches_the_model_at_every_size() {+ for (k, &n) in [0usize, 1, 2, 511, 512, 513, 1024, 1025, 4096, 10_000].iter().enumerate() {+ run(n, 300, 0x1000 + k as u64, false);+ run(n, 150, 0x2000 + k as u64, true);+ }+}++#[test]+fn matches_the_model_at_a_million() {+ run(1_000_000, 60, 77, false);+ run(1_000_000, 40, 78, true);+}++#[test]+fn single_block_bypasses_the_tree() {+ let mut idx = HeightIndex::estimated(100, est(), |_| 5000).unwrap();+ assert_eq!(idx.block_count(), 1);+ for i in 0..100 {+ idx.set_height(i, Fx::from_px(10.0 + i as f64), true);+ }+ assert_eq!(idx.offset_of(3), (10 + 11 + 12) * 64);+ assert_eq!(idx.locate(30 * 64 + 5).unwrap().item, 2);+ idx.check();+}++#[test]+fn prepend_and_append_do_not_rebuild_per_block() {+ let mut idx = HeightIndex::estimated(0, est(), |_| 0).unwrap();+ for _ in 0..200 {+ idx.insert_items(0, 700, 700 * 40).unwrap();+ let n = idx.len();+ idx.insert_items(n, 700, 700 * 40).unwrap();+ }+ idx.check();+ assert_eq!(idx.len(), 280_000);+ assert!(idx.block_count() < 2000);+}++#[test]+fn uniform_ten_million_costs_nothing() {+ let idx = HeightIndex::uniform(10_000_000, Fx::from_px(24.0), est()).unwrap();+ assert_eq!(idx.len(), 10_000_000);+ assert_eq!(idx.total(), 10_000_000 * 24 * 64);+ assert!(idx.heap_bytes() < 2_200_000, "{}", idx.heap_bytes());+ assert_eq!(idx.measured_items(), 0);+ let l = idx.locate(5_000_000 * 24 * 64 + 10).unwrap();+ assert_eq!((l.item, l.within), (5_000_000, 10));+}++#[test]+fn a_different_height_expands_one_block_only() {+ let mut idx = HeightIndex::uniform(1_000_000, Fx::from_px(24.0), est()).unwrap();+ idx.set_height(123_456, Fx::from_px(48.0), true);+ assert_eq!(idx.measured_items(), idx.block_span(123_456).unwrap().0.len());+ assert_eq!(idx.total(), 1_000_000 * 24 * 64 + 24 * 64);+ idx.check();+}++#[test]+fn hostile_inputs_are_refused_or_clamped() {+ assert_eq!(HeightIndex::uniform(usize::MAX, Fx::from_px(1.0), est()).err(), Some(IndexError::TooManyItems));+ let mut idx = HeightIndex::estimated(10, est(), |_| 10).unwrap();+ assert_eq!(idx.insert_items(11, 1, 0), Err(IndexError::OutOfRange));+ assert_eq!(idx.insert_items(0, usize::MAX, 0), Err(IndexError::TooManyItems));+ assert_eq!(idx.remove_items(100, 5, 0), 0);+ assert_eq!(idx.remove_items(8, usize::MAX, 0), 2);+ assert!(!idx.set_height(99, Fx::from_px(5.0), true));+ assert_eq!(Fx::from_px(f64::NAN), Fx::ZERO);+ assert_eq!(Fx::from_px(f64::INFINITY), Fx::MAX);+ assert_eq!(Fx::from_px(-5.0), Fx::ZERO);+ idx.check();+ assert_eq!(idx.len(), 8);+ // empty list queries+ let e = HeightIndex::new(est());+ assert!(e.locate(5).is_none() && e.height_of(0).is_none() && e.block_span(0).is_none());+}++#[test]+fn estimates_converge_to_reality() {+ // real messages are 1.5x the first guess: after observing, estimated blocks follow+ let mut idx = HeightIndex::estimated(100_000, est(), |r| r.len() as u64 * 60).unwrap();+ let before = idx.total();+ for _ in 0..200 {+ idx.observe(60, 1.5 * est().item_raw(60));+ }+ let after = idx.total();+ let ratio = after as f64 / before as f64;+ assert!((ratio - 1.5).abs() < 0.08, "{ratio}");+}++#[test]+fn walks_visit_items_in_order() {+ let mut idx = HeightIndex::estimated(3000, est(), |r| r.len() as u64 * 40).unwrap();+ for i in (0..3000).step_by(7) {+ idx.set_height(i, Fx::from_px(30.0), true);+ }+ let mut seen = Vec::new();+ idx.walk_forward(1000, |i, h, _| {+ seen.push((i, h));+ i < 1100+ });+ assert_eq!(seen.first().unwrap().0, 1000);+ assert_eq!(seen.last().unwrap().0, 1100);+ let mut back = Vec::new();+ idx.walk_backward(1100, |i, h, _| {+ back.push((i, h));+ i > 1000+ });+ back.reverse();+ assert_eq!(back, seen);+ // across a block boundary, backwards to the start+ let mut n = 0;+ idx.walk_backward(2999, |_, _, _| {+ n += 1;+ true+ });+ assert_eq!(n, 3000);+}diff --git a/bindings/rust/blenderui-vlist/src/lib.rs b/bindings/rust/blenderui-vlist/src/lib.rsnew file mode 100644index 0000000..14bc16c--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/lib.rs@@ -0,0 +1,51 @@+//! A variable-height virtualized list for chat-grade UIs, one design for+//! 100 items and for 10M: the logic once, for every UI framework.+//!+//! | Blender | here |+//! |---|---|+//! | `textview_draw` (`space_info/textview.cc`): walk from the newest line backwards, stop past the view top | [`ListView`]: anchor-based position, [`view::Pos::Bottom`] opens at the newest item touching only the last screenful |+//! | `textview_wrap_offsets`: wrap a line where it is drawn | [`wrap`]: the same pass in pixels, cached per `(text, width, size)` ([`measure::TextLayout`]), ASCII from an advance table |+//! | `OffsetIndices`, `accumulate_counts_to_offsets` (`BLI_offset_indices.hh`): static prefix sums | [`index::HeightIndex`]: prefix sums per block under a Fenwick tree, updatable |+//! | BLF glyph cache (`blf_glyph.cc`) | the shared bounded [`blenderui_paint::TextCache`] |+//! | `UI_widgetbase_draw_cache`: batched quads | direct painting of the placed items through [`PaintSink`] |+//!+//! Layering: [`source::ItemSource`] (data) and [`measure::Measurer`]+//! (layout) feed a [`ListView`] (state, index, one frame), which paints+//! through an [`paint::ItemPainter`] into a [`PaintSink`]. [`chat`] is a+//! Measurer + ItemPainter for messages. A framework adapter owns a view+//! next to its source, translates events into view calls and implements+//! `PaintSink`. `std` only.++// Deliberate: heights are fixed-point integers converted at the edges; short+// names in the geometry; exact float comparisons only against sentinels.+#![allow(clippy::float_cmp, clippy::many_single_char_names, clippy::cast_possible_wrap, clippy::items_after_statements)]++pub mod chat;+pub mod estimate;+pub mod fx;+pub mod index;+pub mod list;+pub mod log;+pub mod measure;+pub mod paint;+pub mod scrollbar;+pub mod source;+pub mod synth;+pub mod view;+pub mod wrap;++pub use blenderui_paint::{PaintSink, Palette, Point, Rect, Rgba, TextCache};+pub use chat::{ChatList, ChatStyle};+pub use list::{Hit, List};+pub use estimate::Estimator;+pub use fx::Fx;+pub use index::{HeightIndex, IndexError};+pub use measure::{Measurer, TextLayout, TextWidth};+pub use paint::ItemPainter;+pub use source::{ItemSource, Message, Page, Record, VecSource};+pub use view::{Align, Budget, ListView, Nav, Options, Placed, Pos};+pub use wrap::Lines;++#[cfg(test)]+#[global_allocator]+static ALLOC: blenderui_paint::testing::Counting = blenderui_paint::testing::Counting;diff --git a/bindings/rust/blenderui-vlist/src/list.rs b/bindings/rust/blenderui-vlist/src/list.rsnew file mode 100644index 0000000..d35c1d7--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/list.rs@@ -0,0 +1,135 @@+//! [`List`]: the three things an adapter needs in one place: the items, the+//! style (how they measure and paint) and the [`ListView`]; plus the+//! pointer protocol for the scrollbar. An adapter owns one `List`, forwards+//! its events and implements `PaintSink`; it holds no list logic.++use blenderui_paint::PaintSink;++use crate::measure::{Measurer, TextWidth};+use crate::paint::ItemPainter;+use crate::scrollbar::{Thumb, WIDTH as SCROLL_W};+use crate::source::ItemSource;+use crate::view::{Budget, ListView, Nav, Options, Placed};+use crate::IndexError;++/// What a press landed on.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub enum Hit {+ /// The scrollbar (a drag may have started).+ Scrollbar,+ /// An item.+ Item(usize),+ /// Nothing.+ None,+}++impl Nav {+ /// The navigation a key name stands for (`"pageup"`, `"End"` ...; case-insensitive).+ #[must_use]+ pub fn from_key(name: &str) -> Option<Self> {+ const KEYS: [(&str, Nav); 10] = [+ ("up", Nav::LineUp),+ ("arrowup", Nav::LineUp),+ ("down", Nav::LineDown),+ ("arrowdown", Nav::LineDown),+ ("pageup", Nav::PageUp),+ ("prior", Nav::PageUp),+ ("pagedown", Nav::PageDown),+ ("next", Nav::PageDown),+ ("home", Nav::Home),+ ("end", Nav::End),+ ];+ KEYS.iter().find(|(n, _)| n.eq_ignore_ascii_case(name)).map(|&(_, k)| k)+ }+}++/// See the module docs.+pub struct List<S: ItemSource, P: Measurer + ItemPainter> {+ pub view: ListView,+ pub source: S,+ pub style: P,+ /// Distance from the thumb's top to where it was grabbed.+ drag: Option<f32>,+}++impl<S: ItemSource, P: Measurer + ItemPainter> List<S, P> {+ /// A list of `source` shown through `style` in a `width` x `height` viewport.+ pub fn new(source: S, style: P, width: f32, height: f32, opts: Options) -> Result<Self, IndexError> {+ let view = ListView::new(&source, &style, width, height, opts)?;+ Ok(Self { view, source, style, drag: None })+ }++ /// Lay out the frame (`tw`: the host's text width).+ pub fn layout(&mut self, tw: TextWidth<'_>) -> &[Placed] {+ self.view.layout(&self.source, &self.style, tw)+ }++ /// Paint the laid-out frame.+ pub fn paint(&self, sink: &mut dyn PaintSink) {+ self.view.paint(&self.style, sink);+ }++ /// Resize the viewport (a new width re-wraps everything lazily).+ pub fn resize(&mut self, width: f32, height: f32) {+ self.view.resize(&self.style, width, height);+ }++ /// A theme or font change: new style, everything re-measured lazily.+ pub fn restyle(&mut self, style: P) {+ self.style = style;+ self.view.restyle(&self.style);+ }++ /// Idle measuring ahead of the scroll direction; true while more remains.+ pub fn prefetch(&mut self, tw: TextWidth<'_>, budget: Budget) -> bool {+ self.view.prefetch(&self.source, &self.style, tw, budget)+ }++ /// The scrollbar thumb, if the content is taller than the viewport.+ #[must_use]+ pub fn thumb(&self) -> Option<Thumb> {+ let (top, total) = self.view.scroll_extent();+ let (_, h) = self.view.viewport();+ Thumb::new(top, total, f64::from(h), h)+ }++ /// A key: navigation for a recognised name. Returns whether it was handled.+ pub fn key(&mut self, name: &str, line_px: f64) -> bool {+ Nav::from_key(name).map(|n| self.view.navigate(n, line_px)).is_some()+ }++ /// The primary button pressed at viewport position (`x`, `y`): grabs the+ /// thumb, pages towards a press on the track, or reports the item.+ pub fn pointer_down(&mut self, x: f32, y: f32) -> Hit {+ let (w, h) = self.view.viewport();+ if x >= w - SCROLL_W {+ let Some(t) = self.thumb() else { return Hit::None };+ if y >= t.y && y < t.y + t.h {+ self.drag = Some(y - t.y);+ } else {+ self.view.scroll_by(if y < t.y { -f64::from(h) } else { f64::from(h) });+ }+ return Hit::Scrollbar;+ }+ self.view.item_at(y).map_or(Hit::None, Hit::Item)+ }++ /// The pointer moved to `y`; returns whether the thumb is being dragged.+ pub fn pointer_move(&mut self, y: f32) -> bool {+ let (Some(grab), Some(t)) = (self.drag, self.thumb()) else { return false };+ let (_, h) = self.view.viewport();+ self.view.scroll_to_fraction(t.fraction(y - grab, h));+ true+ }++ /// The button was released.+ pub const fn pointer_up(&mut self) {+ self.drag = None;+ }++ /// Whether the thumb is being dragged.+ #[must_use]+ pub const fn dragging(&self) -> bool {+ self.drag.is_some()+ }+}diff --git a/bindings/rust/blenderui-vlist/src/log.rs b/bindings/rust/blenderui-vlist/src/log.rsnew file mode 100644index 0000000..99e68f3--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/log.rs@@ -0,0 +1,232 @@+//! A file-backed append-only message log: [`ItemSource`] for lists that do+//! not fit (or should not sit) in RAM. Two files: `<base>.idx` holds one+//! fixed 16-byte record per message, `<base>.txt` the text arena. A fetch is+//! two positioned reads (`seek_read` on Windows, `read_at` on Unix), so+//! reading a page costs the same at item 10 and item 10 million and no+//! file position is shared. `bytes(range)` is two 8-byte reads, which is+//! what lets the height index be built over 10M messages without touching+//! them. Ids are `index + 1`.+//!+//! Record layout (little endian): text offset `u40` (5 bytes), text length+//! `u16`, time `u32`, sender `u16`, flags `u8`, media height in 4 px units+//! `u8`, one spare byte.++use std::fs::File;+use std::io::{self, BufWriter, Write};+use std::ops::Range;+use std::path::{Path, PathBuf};++use crate::source::{ItemSource, Message, Page, Record, FLAG_PLACEHOLDER};++const REC: usize = 16;+const MAX_TEXT: usize = u16::MAX as usize;++fn paths(base: &Path) -> (PathBuf, PathBuf) {+ let name = base.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default();+ (base.with_file_name(format!("{name}.idx")), base.with_file_name(format!("{name}.txt")))+}++/// A positioned read that fills `buf` (no shared file position).+fn read_exact_at(f: &File, buf: &mut [u8], off: u64) -> io::Result<()> {+ #[cfg(windows)]+ {+ use std::os::windows::fs::FileExt;+ let mut done = 0;+ while done < buf.len() {+ let n = f.seek_read(&mut buf[done..], off + done as u64)?;+ if n == 0 {+ return Err(io::ErrorKind::UnexpectedEof.into());+ }+ done += n;+ }+ Ok(())+ }+ #[cfg(unix)]+ {+ use std::os::unix::fs::FileExt;+ f.read_exact_at(buf, off)+ }+}++/// Appends messages to a log.+pub struct LogWriter {+ idx: BufWriter<File>,+ txt: BufWriter<File>,+ arena: u64,+ count: u64,+}++impl LogWriter {+ /// Create (truncating) the log at `base`.+ pub fn create(base: &Path) -> io::Result<Self> {+ let (i, t) = paths(base);+ Ok(Self { idx: BufWriter::with_capacity(1 << 20, File::create(i)?), txt: BufWriter::with_capacity(1 << 20, File::create(t)?), arena: 0, count: 0 })+ }++ /// Append `m` (its id is ignored: ids are positions). Text past 64 KB is cut at a character boundary.+ pub fn append(&mut self, m: &Message) -> io::Result<()> {+ let mut len = m.text.len().min(MAX_TEXT);+ while !m.text.is_char_boundary(len) {+ len -= 1;+ }+ let mut r = [0u8; REC];+ r[..5].copy_from_slice(&self.arena.to_le_bytes()[..5]);+ r[5..7].copy_from_slice(&(len as u16).to_le_bytes());+ r[7..11].copy_from_slice(&m.time.to_le_bytes());+ r[11..13].copy_from_slice(&m.sender.to_le_bytes());+ r[13] = m.flags;+ r[14] = (m.media_h / 4).min(255) as u8;+ self.idx.write_all(&r)?;+ self.txt.write_all(&m.text.as_bytes()[..len])?;+ self.arena += len as u64;+ self.count += 1;+ Ok(())+ }++ /// Messages written.+ #[must_use]+ pub const fn count(&self) -> u64 {+ self.count+ }++ /// Flush and close.+ pub fn finish(mut self) -> io::Result<()> {+ self.idx.flush()?;+ self.txt.flush()+ }+}++/// The read side.+pub struct LogSource {+ idx: File,+ txt: File,+ len: usize,+ arena: u64,+ version: u64,+}++struct Rec {+ off: u64,+ len: u16,+ time: u32,+ sender: u16,+ flags: u8,+ media_h: u16,+}++impl Rec {+ fn parse(b: &[u8]) -> Self {+ let mut o = [0u8; 8];+ o[..5].copy_from_slice(&b[..5]);+ Self {+ off: u64::from_le_bytes(o),+ len: u16::from_le_bytes([b[5], b[6]]),+ time: u32::from_le_bytes([b[7], b[8], b[9], b[10]]),+ sender: u16::from_le_bytes([b[11], b[12]]),+ flags: b[13],+ media_h: u16::from(b[14]) * 4,+ }+ }+}++impl LogSource {+ /// Open the log at `base`.+ pub fn open(base: &Path) -> io::Result<Self> {+ let (i, t) = paths(base);+ let (idx, txt) = (File::open(i)?, File::open(t)?);+ let mut s = Self { idx, txt, len: 0, arena: 0, version: 0 };+ s.reload()?;+ Ok(s)+ }++ /// Pick up messages appended since (bumps the version when there are some).+ pub fn reload(&mut self) -> io::Result<()> {+ let len = (self.idx.metadata()?.len() / REC as u64) as usize;+ let arena = self.txt.metadata()?.len();+ if len != self.len || arena != self.arena {+ self.version += 1;+ }+ (self.len, self.arena) = (len, arena);+ Ok(())+ }++ /// Offset of record `i`'s text (`len` gives the arena size).+ fn text_off(&self, i: usize) -> u64 {+ if i >= self.len {+ return self.arena;+ }+ let mut b = [0u8; 8];+ read_exact_at(&self.idx, &mut b[..5], (i * REC) as u64).map_or(self.arena, |()| u64::from_le_bytes(b))+ }++ fn placeholders(page: &mut Page, range: Range<usize>) {+ let a = page.text_mut().len();+ for i in range {+ page.push_span(&Record { id: i as u64 + 1, time: 0, sender: 0, flags: FLAG_PLACEHOLDER, media_h: 0, text: "" }, a..a);+ }+ }+}++impl ItemSource for LogSource {+ fn len(&self) -> usize {+ self.len+ }++ fn version(&self) -> u64 {+ self.version+ }++ fn bytes(&self, r: Range<usize>) -> u64 {+ let (a, b) = (r.start.min(self.len), r.end.min(self.len));+ self.text_off(b.max(a)) - self.text_off(a)+ }++ fn fetch(&self, range: Range<usize>, page: &mut Page) {+ let end = range.end.min(self.len);+ page.reset(range.start);+ if range.start >= end {+ return;+ }+ // the records, through a stack buffer in chunks; spans are relative to the first text offset+ let mut buf = [0u8; REC * 128];+ let (mut base, mut stop, mut i) = (0u64, 0u64, range.start);+ while i < end {+ let n = (end - i).min(128);+ if read_exact_at(&self.idx, &mut buf[..n * REC], (i * REC) as u64).is_err() {+ page.reset(range.start);+ Self::placeholders(page, range.start..end);+ return;+ }+ for (k, b) in buf[..n * REC].as_chunks::<REC>().0.iter().enumerate() {+ let m = Rec::parse(b);+ if i + k == range.start {+ base = m.off;+ }+ stop = m.off + u64::from(m.len);+ let a = (m.off - base) as usize;+ let r = Record { id: (i + k) as u64 + 1, time: m.time, sender: m.sender, flags: m.flags, media_h: m.media_h, text: "" };+ page.push_span(&r, a..a + m.len as usize);+ }+ i += n;+ }+ let mut bytes = std::mem::take(page.scratch_mut());+ bytes.resize((stop - base) as usize, 0);+ if read_exact_at(&self.txt, &mut bytes, base).is_err() {+ *page.scratch_mut() = bytes;+ page.reset(range.start);+ Self::placeholders(page, range.start..end);+ return;+ }+ page.text_mut().push_str(&String::from_utf8_lossy(&bytes));+ *page.scratch_mut() = bytes;+ }++ fn id_at(&self, i: usize) -> Option<u64> {+ (i < self.len).then(|| i as u64 + 1)+ }++ fn index_of(&self, id: u64) -> Option<usize> {+ let i = usize::try_from(id.checked_sub(1)?).ok()?;+ (i < self.len).then_some(i)+ }+}diff --git a/bindings/rust/blenderui-vlist/src/measure.rs b/bindings/rust/blenderui-vlist/src/measure.rsnew file mode 100644index 0000000..79843f8--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/measure.rs@@ -0,0 +1,96 @@+//! Measuring an item: its height from its own record and the list width.+//!+//! A [`Measurer`] describes the item's layout (how wide its text may be,+//! how tall everything that is not text is); [`TextLayout`] does the+//! wrapping and remembers it. The wrapped lines are cached per+//! `(text, wrap width, size)` in the shared bounded+//! [`TextCache`](blenderui_paint::TextCache) (the design of Blender's BLF+//! glyph cache, `blf_glyph.cc`): painting a frame is mostly cache hits, a+//! resize only refills what is on screen, and the cache never holds more+//! than its capacity. A style change (font, size, theme metrics) is+//! [`TextLayout::clear`].++use blenderui_paint::TextCache;++use crate::estimate::Estimator;+use crate::fx::Fx;+use crate::source::Record;+use crate::wrap::{wrap, Advances, Lines};++/// The text measurement the host provides: width of `text` at `size`.+pub type TextWidth<'a> = &'a mut dyn FnMut(&str, f32) -> f32;++/// How an item lays out. Heights depend on the record and the width only.+pub trait Measurer {+ fn font_size(&self) -> f32;+ fn line_height(&self) -> f32;++ /// The width `rec`'s text wraps at in a list `list_width` wide.+ fn wrap_width(&self, rec: &Record<'_>, list_width: f32) -> f32;++ /// Everything of `rec`'s height that is not wrapped text (padding,+ /// header, divider, image).+ fn chrome(&self, rec: &Record<'_>) -> f32;++ /// The estimator for blocks nobody measured, for this list width.+ fn estimator(&self, list_width: f32) -> Estimator;+}++/// Wrapping with a cache.+pub struct TextLayout {+ cache: TextCache<Lines>,+ adv: Advances,+}++impl TextLayout {+ /// A layout cache holding up to `capacity` wrapped texts.+ #[must_use]+ pub fn new(capacity: usize) -> Self {+ Self { cache: TextCache::new(capacity), adv: Advances::default() }+ }++ /// Start a frame (ages the cache).+ pub const fn next_generation(&mut self) {+ self.cache.next_generation();+ }++ /// Make room for a screenful and the next (call with the visible count).+ pub fn ensure_capacity(&mut self, n: usize) {+ self.cache.ensure_capacity(n);+ }++ /// Forget everything (style change).+ pub fn clear(&mut self) {+ self.cache.clear();+ self.adv.reset(0.0);+ }++ /// `(hits, misses)`.+ #[must_use]+ pub const fn stats(&self) -> (u64, u64) {+ self.cache.stats()+ }++ /// The wrapped lines of `rec`'s text at `list_width`.+ pub fn lines(&mut self, rec: &Record<'_>, m: &impl Measurer, list_width: f32, tw: TextWidth<'_>) -> &Lines {+ let (size, w) = (m.font_size(), m.wrap_width(rec, list_width));+ if (self.adv.size() - size).abs() > f32::EPSILON {+ self.adv.reset(size);+ }+ let adv = &mut self.adv;+ self.cache.get_or_insert_with(rec.text, w.to_bits(), size, || wrap(rec.text, w, adv, tw))+ }++ /// The wrapped lines if they are cached (painting reads through a shared+ /// reference; [`ListView::layout`](crate::ListView::layout) has cached what is on screen).+ #[must_use]+ pub fn peek(&self, rec: &Record<'_>, m: &impl Measurer, list_width: f32) -> Option<&Lines> {+ self.cache.peek(rec.text, m.wrap_width(rec, list_width).to_bits(), m.font_size())+ }++ /// `rec`'s full height at `list_width`.+ pub fn height(&mut self, rec: &Record<'_>, m: &impl Measurer, list_width: f32, tw: TextWidth<'_>) -> Fx {+ let lines = self.lines(rec, m, list_width, tw).count();+ Fx::from_px(f64::from(m.chrome(rec)) + lines as f64 * f64::from(m.line_height()))+ }+}diff --git a/bindings/rust/blenderui-vlist/src/paint.rs b/bindings/rust/blenderui-vlist/src/paint.rsnew file mode 100644index 0000000..dd2dd25--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/paint.rs@@ -0,0 +1,60 @@+//! Painting a list: only the placed items, straight into the shared+//! [`PaintSink`] (no element per item), clipped to the viewport, then the+//! scrollbar. What an item looks like is the [`ItemPainter`]'s business+//! (chat: [`crate::chat`]); what is painted is decided by the frame+//! ([`crate::ListView::layout`]). Wrapped lines come from the layout cache:+//! scrolling only moves them, so a steady frame is cache hits and sink calls.+//!+//! Damage regions (repainting only the strip a scroll exposed) need engine+//! support and are not done in the adapters yet (see the docs).++use blenderui_paint::{PaintSink, Palette, Rect};++use crate::measure::Measurer;+use crate::scrollbar::Thumb;+use crate::source::Record;+use crate::view::ListView;+use crate::wrap::Lines;++/// Draws one item.+pub trait ItemPainter {+ /// The theme colors (background and scrollbar are painted with them).+ fn palette(&self) -> &Palette;+ /// A measured item in `r` (viewport coordinates).+ fn item(&self, sink: &mut dyn PaintSink, r: Rect, rec: &Record<'_>, lines: &Lines);+ /// An item not measured or not loaded: a placeholder in `r`.+ fn skeleton(&self, sink: &mut dyn PaintSink, r: Rect, rec: Option<&Record<'_>>);+}++impl ListView {+ /// Paint the frame laid out by [`ListView::layout`].+ pub fn paint<S: Measurer + ItemPainter>(&self, style: &S, sink: &mut dyn PaintSink) {+ let pal = *style.palette();+ let (w, h) = (self.width, self.height);+ sink.fill(Rect::new(0.0, 0.0, w, h), pal.back);+ let thumb = {+ let (top, total) = self.scroll_extent();+ Thumb::new(top, total, f64::from(h), h)+ };+ let (placed, page, text) = (&self.placed, &self.page, &self.text);+ sink.clipped(Rect::new(0.0, 0.0, w, h), &mut |s: &mut dyn PaintSink| {+ for p in placed {+ let r = Rect::new(0.0, p.y, w, p.h);+ let rec = page.record(p.item);+ match rec {+ Some(rec) if p.exact && rec.flags & crate::source::FLAG_PLACEHOLDER == 0 => {+ // the frame cached these lines; a miss (evicted meanwhile) shows a skeleton+ match text.peek(&rec, style, w) {+ Some(lines) => style.item(s, r, &rec, lines),+ None => style.skeleton(s, r, Some(&rec)),+ }+ }+ other => style.skeleton(s, r, other.as_ref()),+ }+ }+ if let Some(t) = thumb {+ t.paint(s, &pal, w, h);+ }+ });+ }+}diff --git a/bindings/rust/blenderui-vlist/src/scrollbar.rs b/bindings/rust/blenderui-vlist/src/scrollbar.rsnew file mode 100644index 0000000..b874c5e--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/scrollbar.rs@@ -0,0 +1,75 @@+//! The scrollbar: a thumb sized and placed from the *estimated* content+//! height, with a minimum size so it stays grabbable at 10M items, and the+//! drag mapping back to a fraction of the content. Dragging far picks an+//! anchor from the estimate ([`crate::ListView::scroll_to_fraction`]); as+//! the items around it are measured the estimate improves but the anchor+//! stays, so the content under the pointer does not fight the user (only+//! the thumb adjusts). The look is Blender's slider: a thin rounded thumb+//! on a darkened track.++use blenderui_paint::{PaintSink, Palette, Rect};++/// Scrollbar width in px.+pub const WIDTH: f32 = 10.0;+/// The smallest thumb.+pub const MIN_THUMB: f32 = 24.0;++/// The thumb inside a track.+#[derive(Copy, Clone, Debug, PartialEq)]+pub struct Thumb {+ pub y: f32,+ pub h: f32,+}++impl Thumb {+ /// The thumb for scroll position `top` of `total` px of content with a+ /// `view` px viewport in a `track` px track; `None` when everything fits.+ #[must_use]+ pub fn new(top: f64, total: f64, view: f64, track: f32) -> Option<Self> {+ if !(total > view && view > 0.0 && track > 0.0) {+ return None;+ }+ let h = ((f64::from(track) * view / total) as f32).clamp(MIN_THUMB.min(track), track);+ let free = f64::from(track - h);+ let y = (free * (top / (total - view)).clamp(0.0, 1.0)) as f32;+ Some(Self { y, h })+ }++ /// The content fraction for a thumb whose top is at `y` in the track.+ #[must_use]+ pub fn fraction(&self, y: f32, track: f32) -> f64 {+ let free = f64::from(track - self.h);+ if free <= 0.0 { 0.0 } else { (f64::from(y) / free).clamp(0.0, 1.0) }+ }++ /// Paint the track and thumb at the right edge of a `width` x `height` viewport.+ pub fn paint(&self, sink: &mut dyn PaintSink, pal: &Palette, width: f32, height: f32) {+ sink.fill(Rect::new(width - WIDTH, 0.0, WIDTH, height), pal.back.shade(-6.0));+ sink.round(Rect::new(width - WIDTH + 2.0, self.y + 1.0, WIDTH - 4.0, (self.h - 2.0).max(1.0)), (WIDTH - 4.0) * 0.5, pal.text.opacity(0.35));+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn thumb_is_proportional_and_bounded() {+ let t = Thumb::new(0.0, 1000.0, 100.0, 200.0).unwrap();+ assert_eq!((t.y, t.h), (0.0, 24.0));+ let end = Thumb::new(900.0, 1000.0, 100.0, 200.0).unwrap();+ assert!((end.y + end.h - 200.0).abs() < 0.01);+ // 10M items: the thumb stays grabbable+ let tiny = Thumb::new(0.0, 6e8, 600.0, 600.0).unwrap();+ assert_eq!(tiny.h, MIN_THUMB);+ assert!(Thumb::new(0.0, 50.0, 100.0, 200.0).is_none());+ }++ #[test]+ fn fraction_inverts_position() {+ let t = Thumb::new(450.0, 1000.0, 100.0, 200.0).unwrap();+ assert!((t.fraction(t.y, 200.0) - 0.5).abs() < 0.01);+ assert_eq!(t.fraction(-5.0, 200.0), 0.0);+ assert_eq!(t.fraction(1e9, 200.0), 1.0);+ }+}diff --git a/bindings/rust/blenderui-vlist/src/source.rs b/bindings/rust/blenderui-vlist/src/source.rsnew file mode 100644index 0000000..e7549cc--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/source.rs@@ -0,0 +1,296 @@+//! Where the items come from.+//!+//! An [`ItemSource`] answers `len`, an aggregate of text bytes per range (so+//! an estimate needs no per-item data), and `fetch(range, page)`: the+//! records of a range copied into a reusable [`Page`] (a metadata vector and+//! one text buffer: after the first fetches, fetching allocates nothing).+//! Items not loaded yet come back as placeholders; [`ItemSource::ensure_loaded`]+//! asks for them without blocking. The in-memory [`VecSource`] is here; the+//! file-backed log is [`crate::log`].++use std::ops::Range;++/// The group header (avatar, name, time) is shown above this item.+pub const FLAG_HEADER: u8 = 1;+/// A date divider is shown above this item.+pub const FLAG_DIVIDER: u8 = 2;+/// Not loaded yet: the text is empty and the height an estimate.+pub const FLAG_PLACEHOLDER: u8 = 4;+/// Sent by the local user.+pub const FLAG_OWN: u8 = 8;++/// One item. Everything that decides its height is in the record itself+/// (neighbour-dependent layout was decided when it was inserted and lives+/// in `flags`), so a height depends on its own record only.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub struct Record<'a> {+ /// Stable, ascending with the index.+ pub id: u64,+ /// Seconds since the epoch.+ pub time: u32,+ pub sender: u16,+ pub flags: u8,+ /// Height of an attached image in px (0: none). Known before the image+ /// loads, so loading it shifts nothing.+ pub media_h: u16,+ pub text: &'a str,+}++#[derive(Copy, Clone, Debug)]+struct Meta {+ id: u64,+ time: u32,+ sender: u16,+ flags: u8,+ media_h: u16,+ text: (u32, u32),+}++impl Meta {+ const fn new(r: &Record<'_>, text: (u32, u32)) -> Self {+ Self { id: r.id, time: r.time, sender: r.sender, flags: r.flags, media_h: r.media_h, text }+ }+}++/// A reusable run of records.+#[derive(Default)]+pub struct Page {+ start: usize,+ metas: Vec<Meta>,+ text: String,+ scratch: Vec<u8>,+}++impl Page {+ #[must_use]+ pub fn new() -> Self {+ Self::default()+ }++ /// Empty the page, to hold records from `start` on.+ pub fn reset(&mut self, start: usize) {+ self.start = start;+ self.metas.clear();+ self.text.clear();+ }++ /// Append the next record.+ pub fn push(&mut self, r: &Record<'_>) {+ let a = self.text.len() as u32;+ self.text.push_str(r.text);+ self.metas.push(Meta::new(r, (a, self.text.len() as u32)));+ }++ /// The text buffer, for sources that read straight into it; then call+ /// [`Page::push_span`] for each record.+ pub const fn text_mut(&mut self) -> &mut String {+ &mut self.text+ }++ /// A byte buffer sources use for reads (take it, use it, put it back: it keeps its capacity).+ pub const fn scratch_mut(&mut self) -> &mut Vec<u8> {+ &mut self.scratch+ }++ /// Append a record whose text (`r.text` is ignored) is already in the buffer at `text`.+ pub fn push_span(&mut self, r: &Record<'_>, text: Range<usize>) {+ self.metas.push(Meta::new(r, (text.start as u32, text.end as u32)));+ }++ /// The items the page holds.+ #[must_use]+ pub const fn range(&self) -> Range<usize> {+ self.start..self.start + self.metas.len()+ }++ #[must_use]+ pub fn record(&self, item: usize) -> Option<Record<'_>> {+ let m = self.metas.get(item.checked_sub(self.start)?)?;+ let text = self.text.get(m.text.0 as usize..m.text.1 as usize)?;+ Some(Record { id: m.id, time: m.time, sender: m.sender, flags: m.flags, media_h: m.media_h, text })+ }+}++/// See the module docs.+pub trait ItemSource {+ fn len(&self) -> usize;++ fn is_empty(&self) -> bool {+ self.len() == 0+ }++ /// Changes whenever the items change; a [`Page`] is refetched after it moves.+ fn version(&self) -> u64;++ /// Text bytes in `range` (an aggregate: O(1) for a source with an offsets table).+ fn bytes(&self, range: Range<usize>) -> u64;++ /// Fill `page` with the records of `range` (clamped to `len`), in order.+ /// Items not loaded yet are [`FLAG_PLACEHOLDER`] records.+ fn fetch(&self, range: Range<usize>, page: &mut Page);++ /// The stable id of `index`.+ fn id_at(&self, index: usize) -> Option<u64>;++ /// The index of id `id` (ids ascend with the index: a binary search).+ fn index_of(&self, id: u64) -> Option<usize>;++ /// Ask for `range` to be loaded; never blocks. A synchronous source has nothing to do.+ fn ensure_loaded(&self, _range: Range<usize>) {}++ /// Stop loading `range` (the user scrolled away).+ fn cancel(&self, _range: Range<usize>) {}+}++/// An owned message.+#[derive(Clone, Debug, PartialEq, Eq)]+pub struct Message {+ pub id: u64,+ pub time: u32,+ pub sender: u16,+ pub flags: u8,+ pub media_h: u16,+ pub text: String,+}++impl Message {+ #[must_use]+ pub fn record(&self) -> Record<'_> {+ Record { id: self.id, time: self.time, sender: self.sender, flags: self.flags, media_h: self.media_h, text: &self.text }+ }+}++/// An in-memory source.+pub struct VecSource {+ items: Vec<Message>,+ /// Text bytes before each item: `bytes(a..b)` is a subtraction.+ cum: Vec<u64>,+ version: u64,+}++impl Default for VecSource {+ fn default() -> Self {+ Self::new()+ }+}++impl VecSource {+ #[must_use]+ pub fn new() -> Self {+ Self { items: Vec::new(), cum: vec![0], version: 0 }+ }++ #[must_use]+ pub fn from_messages(items: Vec<Message>) -> Self {+ let mut s = Self::new();+ s.items.reserve(items.len());+ for m in items {+ s.push(m);+ }+ s+ }++ pub fn push(&mut self, m: Message) {+ self.cum.push(self.cum[self.items.len()] + m.text.len() as u64);+ self.items.push(m);+ self.version += 1;+ }++ /// Insert older messages before everything (a history page; their ids precede the first).+ pub fn prepend(&mut self, mut older: Vec<Message>) {+ older.append(&mut self.items);+ let v = self.version + 1;+ *self = Self::from_messages(older);+ self.version = v;+ }++ /// Replace item `i`'s text (streaming growth, an edit).+ pub fn set_text(&mut self, i: usize, text: &str) {+ let old = self.items[i].text.len() as u64;+ self.items[i].text.clear();+ self.items[i].text.push_str(text);+ let d = text.len() as u64;+ for c in &mut self.cum[i + 1..] {+ *c = *c - old + d;+ }+ self.version += 1;+ }++ /// Remove item `i`.+ pub fn remove(&mut self, i: usize) -> Message {+ let m = self.items.remove(i);+ let w = m.text.len() as u64;+ self.cum.remove(i + 1);+ for c in &mut self.cum[i + 1..] {+ *c -= w;+ }+ self.version += 1;+ m+ }++ #[must_use]+ pub fn get(&self, i: usize) -> Option<&Message> {+ self.items.get(i)+ }+}++impl ItemSource for VecSource {+ fn len(&self) -> usize {+ self.items.len()+ }+ fn version(&self) -> u64 {+ self.version+ }+ fn bytes(&self, r: Range<usize>) -> u64 {+ let (a, b) = (r.start.min(self.items.len()), r.end.min(self.items.len()));+ self.cum[b.max(a)] - self.cum[a]+ }+ fn fetch(&self, range: Range<usize>, page: &mut Page) {+ let end = range.end.min(self.items.len());+ page.reset(range.start);+ for m in self.items.get(range.start..end).unwrap_or_default() {+ page.push(&m.record());+ }+ }+ fn id_at(&self, i: usize) -> Option<u64> {+ self.items.get(i).map(|m| m.id)+ }+ fn index_of(&self, id: u64) -> Option<usize> {+ self.items.binary_search_by_key(&id, |m| m.id).ok()+ }+}++/// A shared or boxed source is a source (so one source can feed several+/// consumers, or be chosen at run time).+macro_rules! forward_source {+ ($($ptr:ty),*) => {$(+ impl<T: ItemSource + ?Sized> ItemSource for $ptr {+ fn len(&self) -> usize {+ (**self).len()+ }+ fn version(&self) -> u64 {+ (**self).version()+ }+ fn bytes(&self, range: Range<usize>) -> u64 {+ (**self).bytes(range)+ }+ fn fetch(&self, range: Range<usize>, page: &mut Page) {+ (**self).fetch(range, page);+ }+ fn id_at(&self, index: usize) -> Option<u64> {+ (**self).id_at(index)+ }+ fn index_of(&self, id: u64) -> Option<usize> {+ (**self).index_of(id)+ }+ fn ensure_loaded(&self, range: Range<usize>) {+ (**self).ensure_loaded(range);+ }+ fn cancel(&self, range: Range<usize>) {+ (**self).cancel(range);+ }+ }+ )*};+}++forward_source!(Box<T>, std::rc::Rc<T>, std::sync::Arc<T>);diff --git a/bindings/rust/blenderui-vlist/src/synth.rs b/bindings/rust/blenderui-vlist/src/synth.rsnew file mode 100644index 0000000..1ef8967--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/synth.rs@@ -0,0 +1,63 @@+//! Deterministic synthetic chat data: the same messages for the tests, the+//! benchmarks, the file-backed log and the competitor harnesses, so every+//! comparison is on identical data. Message `i` is a pure function of `i`.++use crate::chat::classify;+use crate::source::Message;++const WORDS: [&str; 24] = [+ "the", "build", "is", "green", "again", "can", "someone", "review", "my", "patch", "before", "lunch", "ok", "that", "works", "on",+ "windows", "but", "not", "linux", "thanks", "see", "you", "tomorrow",+];++const EPOCH: u32 = 1_700_000_000;++const fn mix(mut x: u64) -> u64 {+ x ^= x >> 33;+ x = x.wrapping_mul(0xff51_afd7_ed55_8ccd);+ x ^= x >> 33;+ x = x.wrapping_mul(0xc4ce_b9fe_1a85_ec53);+ x ^ (x >> 33)+}++/// Message `i` (its id is `i + 1`), flags unset (see [`messages`]).+#[must_use]+pub fn message(i: u64) -> Message {+ let h = mix(i);+ let sender = (h % 9) as u16;+ let time = EPOCH + (i * 37) as u32 + (mix(i ^ 7) % 30) as u32;+ // mostly one-liners, some paragraphs, a few walls of text+ let words = match (h >> 8) & 15 {+ 0..=9 => 3 + (h >> 16) % 10,+ 10..=14 => 14 + (h >> 16) % 30,+ _ => 60 + (h >> 16) % 140,+ };+ let mut text = String::with_capacity(words as usize * 6);+ let mut x = h;+ for k in 0..words {+ x = mix(x.wrapping_add(k));+ if k > 0 {+ text.push(' ');+ }+ text.push_str(WORDS[(x % WORDS.len() as u64) as usize]);+ }+ let media_h = if (h >> 40).is_multiple_of(40) { 120 + ((h >> 48) % 100) as u16 } else { 0 };+ Message { id: i + 1, time, sender, flags: 0, media_h, text }+}++/// The classified messages `from..to`.+#[must_use]+pub fn messages(from: u64, to: u64) -> Vec<Message> {+ let mut prev = from.checked_sub(1).map(|p| {+ let m = message(p);+ (m.sender, m.time)+ });+ (from..to)+ .map(|i| {+ let mut m = message(i);+ m.flags = classify(prev, m.sender, m.time);+ prev = Some((m.sender, m.time));+ m+ })+ .collect()+}diff --git a/bindings/rust/blenderui-vlist/src/view/edit.rs b/bindings/rust/blenderui-vlist/src/view/edit.rsnew file mode 100644index 0000000..20552b1--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/view/edit.rs@@ -0,0 +1,82 @@+//! What the owner of the items tells the view when they change. Each call+//! keeps the anchor on the same item (so nothing the user looks at moves)+//! and costs O(log blocks) plus the work of one block.++use super::{ListView, Pos};+use crate::fx::Fx;+use crate::index::IndexError;++impl ListView {+ /// `count` items holding `bytes` of text were added at the end (new+ /// messages). While pinned to the bottom the view follows them.+ pub fn appended(&mut self, count: usize, bytes: u64) -> Result<(), IndexError> {+ self.index.insert_items(self.index.len(), count, bytes)+ }++ /// `count` older items were added at the start (a history page). The+ /// anchor moves with its item: no jump.+ pub fn prepended(&mut self, count: usize, bytes: u64) -> Result<(), IndexError> {+ self.inserted(0, count, bytes)+ }++ /// `count` items were inserted before item `at`.+ pub fn inserted(&mut self, at: usize, count: usize, bytes: u64) -> Result<(), IndexError> {+ self.index.insert_items(at, count, bytes)?;+ if let Pos::Anchor { item, .. } = &mut self.pos+ && at <= *item+ {+ *item += count;+ }+ if let Some((g, _)) = &mut self.goal+ && at <= *g+ {+ *g += count;+ }+ self.page_version = u64::MAX;+ Ok(())+ }++ /// `count` items starting at `at` were removed; they held `bytes` of text.+ pub fn removed(&mut self, at: usize, count: usize, bytes: u64) {+ let n = self.index.remove_items(at, count, bytes);+ if let Pos::Anchor { item, off } = &mut self.pos {+ if *item >= at + n {+ *item -= n;+ } else if *item >= at {+ // the anchor item itself went: the next item takes its place+ *item = at;+ *off = 0;+ }+ }+ if let Some((g, _)) = &mut self.goal {+ if *g >= at + n {+ *g -= n;+ } else if *g >= at {+ self.goal = None;+ }+ }+ self.page_version = u64::MAX;+ }++ /// Item `item` changed (an edit, a streaming token, a new image): it is+ /// re-measured at the next frame. Many calls between frames cost one+ /// measurement per item.+ pub fn changed(&mut self, item: usize) {+ if let Some((h, _)) = self.index.height_of(item) {+ self.index.set_height(item, h, false);+ }+ self.page_version = u64::MAX;+ }++ /// Item `item`'s text changed from `old_bytes` to `new_bytes` bytes (streaming growth):+ /// the aggregate follows and the item is re-measured at the next frame.+ pub fn edited(&mut self, item: usize, old_bytes: u64, new_bytes: u64) {+ self.index.change_bytes(item, old_bytes, new_bytes);+ self.changed(item);+ }++ /// A known height for `item` (an image whose size arrived).+ pub fn set_known_height(&mut self, item: usize, h_px: f64) {+ self.index.set_height(item, Fx::from_px(h_px), true);+ }+}diff --git a/bindings/rust/blenderui-vlist/src/view/frame.rs b/bindings/rust/blenderui-vlist/src/view/frame.rsnew file mode 100644index 0000000..a7325ac--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/view/frame.rs@@ -0,0 +1,305 @@+//! One frame: from the position to the list of items to paint.+//!+//! 1. resolve the anchor (a goal being chased, the end, or the stored anchor);+//! 2. walk the index from it, placing items until the viewport is full;+//! 3. measure the placed items nobody has measured, within the budget, and+//! write the results back in one batch ([`HeightIndex::set_heights`]);+//! when a height changed, place again (the anchor item did not move, so+//! only what is below it can shift);+//! 4. at the end of the list with room left, move up so the list ends at the+//! bottom edge (or pin to it when sticking);+//! 5. ask the source to load what is on screen, unless the user is flinging.+//!+//! A placed item that could not be measured in budget keeps its estimated+//! height and is flagged inexact: the painter draws a skeleton for it.+//! Everything here reuses the view's buffers: a steady frame allocates nothing.++use std::ops::Range;+use std::time::{Duration, Instant};++use super::{ListView, Pos};+use crate::fx::units_to_px;+use crate::measure::{Measurer, TextWidth};+use crate::source::{ItemSource, FLAG_PLACEHOLDER};++/// How much measuring a frame may do.+#[derive(Copy, Clone, Debug)]+pub enum Budget {+ Unlimited,+ /// At most this many items.+ Items(usize),+ /// Until this much time has passed.+ Time(Duration),+}++/// A running budget.+struct Clock {+ budget: Budget,+ start: Instant,+ done: usize,+}++impl Clock {+ fn new(budget: Budget) -> Self {+ Self { budget, start: Instant::now(), done: 0 }+ }++ fn exhausted(&self) -> bool {+ match self.budget {+ Budget::Unlimited => false,+ Budget::Items(n) => self.done >= n,+ // at least one item per frame, so a slow measurer still progresses+ Budget::Time(t) => self.done > 0 && self.start.elapsed() >= t,+ }+ }+}++/// An item placed in the viewport.+#[derive(Copy, Clone, Debug, PartialEq)]+pub struct Placed {+ pub item: usize,+ /// Top edge relative to the viewport top (negative: partly above).+ pub y: f32,+ pub h: f32,+ /// Measured (false: an estimate, painted as a skeleton).+ pub exact: bool,+}++impl ListView {+ fn budget(&self) -> Budget {+ if self.flinging() { self.opts.fling_budget } else { Budget::Unlimited }+ }++ /// The anchor for this pass: the goal, the end, or the stored one, clamped to the list.+ fn resolve(&mut self) -> (usize, u64) {+ if let Some((item, align)) = self.goal {+ self.pos = self.goal_pos(item, align);+ }+ if self.pos == Pos::Bottom+ && let Pos::Anchor { item, off } = self.bottom_anchor()+ {+ return (item, off);+ }+ let Pos::Anchor { item, off } = self.pos else { return (0, 0) };+ let item = item.min(self.index.len().saturating_sub(1));+ let h = self.index.height_of(item).map_or(0, |(h, _)| u64::from(h.units()));+ let off = off.min(h);+ self.pos = Pos::Anchor { item, off };+ (item, off)+ }++ /// Fill `placed` from the anchor.+ fn place(&mut self, item: usize, off: u64) {+ self.placed.clear();+ let view = f64::from(self.height);+ let mut y = 0.0 - units_to_px(off);+ let placed = &mut self.placed;+ self.index.walk_forward(item, |i, h, exact| {+ placed.push(super::Placed { item: i, y: y as f32, h: h.px() as f32, exact });+ y += h.px();+ y < view+ });+ }++ /// Whether the last item is placed and its bottom is above the viewport bottom (with more content than the viewport).+ fn ends_short(&self) -> bool {+ let view = f64::from(self.height);+ self.placed.last().is_some_and(|p| p.item + 1 == self.index.len() && f64::from(p.y + p.h) < view - 0.01) && self.scroll_extent().1 > view+ }++ /// Make `self.page` cover `range` (refetching when the source changed).+ fn ensure_page<S: ItemSource>(&mut self, src: &S, range: &Range<usize>) {+ let have = self.page.range();+ if self.page_version == src.version() && have.start <= range.start && have.end >= range.end {+ return;+ }+ let margin = range.len().max(16);+ let start = range.start.saturating_sub(margin / 2);+ let end = range.end.saturating_add(margin).min(src.len());+ src.fetch(start..end, &mut self.page);+ self.page_version = src.version();+ }++ /// Measure the placed items that are not exact, within `clock`. Returns+ /// whether a height was written (the placement must be redone).+ fn measure_placed<S: ItemSource, M: Measurer>(&mut self, src: &S, m: &M, tw: TextWidth<'_>, clock: &mut Clock) -> bool {+ let (Some(a), Some(b)) = (self.placed.first(), self.placed.last()) else { return false };+ let range = a.item..b.item + 1;+ self.ensure_page(src, &range);+ self.updates.clear();+ self.samples.clear();+ for p in &self.placed {+ if p.exact {+ continue;+ }+ if clock.exhausted() {+ self.more_to_measure = true;+ break;+ }+ let Some(rec) = self.page.record(p.item) else { continue };+ if rec.flags & FLAG_PLACEHOLDER != 0 {+ continue;+ }+ let h = self.text.height(&rec, m, self.width, tw);+ self.updates.push((p.item, h));+ self.samples.push((rec.text.len() as u64, h.px()));+ clock.done += 1;+ }+ self.commit_measured()+ }++ /// Write `updates` and learn from `samples`. Returns whether there were any.+ pub(crate) fn commit_measured(&mut self) -> bool {+ if self.updates.is_empty() {+ return false;+ }+ self.index.set_heights(&mut self.updates);+ for &(bytes, px) in &self.samples {+ self.index.observe(bytes, px);+ }+ true+ }++ /// Lay out the frame and return the items to paint (viewport-relative).+ /// `tw` measures text widths (the host's shaper).+ pub fn layout<S: ItemSource, M: Measurer>(&mut self, src: &S, m: &M, tw: TextWidth<'_>) -> &[Placed] {+ self.text.next_generation();+ self.text.ensure_capacity(self.placed.len() * 4);+ if src.len() != self.index.len() {+ self.resync(src, m);+ }+ self.more_to_measure = false;+ let mut clock = Clock::new(self.budget());+ for pass in 0..6 {+ let (item, off) = self.resolve();+ self.place(item, off);+ let changed = self.measure_placed(src, m, tw, &mut clock);+ if changed {+ if !clock.exhausted() && pass < 5 {+ continue;+ }+ // out of budget or passes: place once more with what was learned+ let (item, off) = self.resolve();+ self.place(item, off);+ }+ if self.ends_short() && matches!(self.pos, Pos::Anchor { .. }) && pass < 5 {+ // the list ended above the bottom edge: slide down to it+ self.pos = if self.opts.stick_to_bottom { Pos::Bottom } else { self.bottom_anchor() };+ continue;+ }+ break;+ }+ if let (Some(a), Some(b)) = (self.placed.first(), self.placed.last()) {+ let range = a.item..b.item + 1;+ self.ensure_page(src, &range);+ self.request_loads(src, &range);+ }+ if let Some((item, _)) = self.goal+ && (self.placed.iter().any(|p| p.item == item && p.exact) || self.index.height_of(item).is_some_and(|(_, e)| e))+ {+ self.goal = None;+ }+ // cache the wrapped lines of what is shown: painting is read-only and only looks them up+ for p in &self.placed {+ if let Some(rec) = self.page.record(p.item).filter(|r| p.exact && r.flags & FLAG_PLACEHOLDER == 0) {+ self.text.lines(&rec, m, self.width, tw);+ }+ }+ self.fling *= 0.7;+ self.frames = self.frames.wrapping_add(1);+ if self.frames.is_multiple_of(32) {+ let center = self.placed.first().map_or(0, |p| p.item);+ self.index.trim(center, self.opts.max_measured);+ }+ &self.placed+ }++ /// Ask the source for what is on screen (and a little ahead), unless the+ /// user is flinging; cancel what we asked for before and no longer need.+ fn request_loads<S: ItemSource>(&mut self, src: &S, shown: &Range<usize>) {+ let page = self.page.range();+ let wants = shown.clone().any(|i| self.page.record(i).is_some_and(|r| r.flags & FLAG_PLACEHOLDER != 0));+ if !wants || self.flinging() {+ return;+ }+ let ahead = shown.len().max(8);+ let want = if self.last_dir >= 0 { shown.start..(shown.end + ahead).min(page.end) } else { shown.start.saturating_sub(ahead).max(page.start)..shown.end };+ if self.requested.as_ref() != Some(&want) {+ if let Some(old) = self.requested.replace(want.clone()) {+ src.cancel(old);+ }+ src.ensure_loaded(want);+ }+ }++ /// The source's items changed without the view being told: rebuild the+ /// index (measured heights are lost), keeping the anchor item.+ pub(crate) fn resync<S: ItemSource, M: Measurer>(&mut self, src: &S, m: &M) {+ let est = m.estimator(self.width.max(1.0));+ if let Ok(index) = crate::index::HeightIndex::estimated(src.len(), est, |r| src.bytes(r)) {+ self.index = index;+ }+ self.page_version = u64::MAX;+ if let Pos::Anchor { item, .. } = &mut self.pos {+ *item = (*item).min(src.len().saturating_sub(1));+ }+ }++ /// Idle work: measure the items beyond the viewport in the scroll+ /// direction, so a flick finds them measured. Returns whether more+ /// remains (ask for another frame while true).+ pub fn prefetch<S: ItemSource, M: Measurer>(&mut self, src: &S, m: &M, tw: TextWidth<'_>, budget: Budget) -> bool {+ let (Some(a), Some(b)) = (self.placed.first(), self.placed.last()) else { return false };+ let n = (self.placed.len() * 3).max(48);+ let (first, last) = (a.item, b.item);+ let range = if self.last_dir >= 0 { last + 1..(last + 1 + n).min(self.index.len()) } else { first.saturating_sub(n)..first };+ if range.is_empty() {+ return false;+ }+ let mut todo: Vec<usize> = Vec::new();+ self.index.walk_forward(range.start, |i, _, exact| {+ if i >= range.end {+ return false;+ }+ if !exact {+ todo.push(i);+ }+ true+ });+ if todo.is_empty() {+ return false;+ }+ src.fetch(range, &mut self.ahead);+ let mut clock = Clock::new(budget);+ self.updates.clear();+ self.samples.clear();+ let mut left = false;+ for &i in &todo {+ if clock.exhausted() {+ left = true;+ break;+ }+ let Some(rec) = self.ahead.record(i) else { continue };+ if rec.flags & FLAG_PLACEHOLDER != 0 {+ continue;+ }+ let h = self.text.height(&rec, m, self.width, tw);+ self.updates.push((i, h));+ self.samples.push((rec.text.len() as u64, h.px()));+ clock.done += 1;+ }+ self.commit_measured();+ self.more_to_measure = left;+ left+ }++ /// The anchor item and its offset in px, for tests and adapters.+ #[must_use]+ pub fn anchor_px(&self) -> Option<(usize, f64)> {+ match self.pos {+ Pos::Anchor { item, off } => Some((item, units_to_px(off))),+ Pos::Bottom => None,+ }+ }++}diff --git a/bindings/rust/blenderui-vlist/src/view/mod.rs b/bindings/rust/blenderui-vlist/src/view/mod.rsnew file mode 100644index 0000000..c0b1c17--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/view/mod.rs@@ -0,0 +1,391 @@+//! [`ListView`]: the scroll state and everything a frame needs, around one+//! [`HeightIndex`].+//!+//! **Position is an anchor**, not a pixel offset: `(item, offset inside the+//! item)`. Items are painted relative to it in small local `f32`+//! coordinates, so there is no precision problem at 10M items, and a height+//! that changes above the viewport (an image arrived, a block was+//! measured, history was prepended) cannot move what the user sees: the+//! anchor item is where it was. The alternative position, [`Pos::Bottom`],+//! is "the end of the list at the bottom edge" (chat autoscroll,+//! open-at-newest): it has no anchor at all, and is recomputed each frame+//! from the end, so opening a 10M-message chat at the newest message+//! touches only the last screenful.+//!+//! Blender's text view (`textview_draw`) does the second thing only: it+//! starts from the newest line and walks backwards, wrapping each line.+//!+//! * [`frame`]: one frame (resolve the anchor, place items, measure what is+//! unmeasured within the budget, clamp at the end, prefetch).+//! * [`edit`]: what the owner tells the view when the items change.++mod edit;+mod frame;++use std::time::Duration;++use crate::fx::{px_to_units, units_to_px};+use crate::index::{HeightIndex, IndexError};+use crate::measure::{Measurer, TextLayout};+use crate::source::{ItemSource, Page};++pub use frame::{Budget, Placed};++/// Where the viewport is.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub enum Pos {+ /// The top of the viewport is `off` fixed-point units below the top of `item`.+ Anchor { item: usize, off: u64 },+ /// The end of the list is at the bottom of the viewport; stays there as items arrive.+ Bottom,+}++/// Where a jumped-to item ends up.+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub enum Align {+ Start,+ Center,+ End,+}++/// Keyboard navigation (an adapter maps its keys to these).+#[derive(Copy, Clone, Debug, PartialEq, Eq)]+pub enum Nav {+ LineUp,+ LineDown,+ PageUp,+ PageDown,+ Home,+ End,+}++/// Behaviour switches.+#[derive(Copy, Clone, Debug)]+pub struct Options {+ /// Follow new items while at the bottom; stop when the user scrolls up;+ /// resume when they reach the bottom again.+ pub stick_to_bottom: bool,+ /// Open at the newest item.+ pub start_at_end: bool,+ /// Wrapped texts the layout cache keeps.+ pub cache_capacity: usize,+ /// Measure budget while the user is flinging (what is not measured is+ /// drawn as a skeleton at its estimated height).+ pub fling_budget: Budget,+ /// Most items whose heights are held one by one (older ones go back to+ /// estimates, far from the viewport first).+ pub max_measured: usize,+}++impl Default for Options {+ fn default() -> Self {+ Self {+ stick_to_bottom: true,+ start_at_end: false,+ cache_capacity: 4096,+ fling_budget: Budget::Time(Duration::from_micros(500)),+ max_measured: 1 << 20,+ }+ }+}++/// See the module docs.+pub struct ListView {+ pub(crate) index: HeightIndex,+ pub(crate) text: TextLayout,+ pub(crate) page: Page,+ pub(crate) page_version: u64,+ pub(crate) ahead: Page,+ pub(crate) pos: Pos,+ pub(crate) goal: Option<(usize, Align)>,+ pub(crate) width: f32,+ pub(crate) height: f32,+ pub(crate) opts: Options,+ pub(crate) placed: Vec<Placed>,+ pub(crate) updates: Vec<(usize, crate::fx::Fx)>,+ pub(crate) samples: Vec<(u64, f64)>,+ /// Smooth-scroll distance still to go, px.+ pub(crate) pending: f64,+ /// Recent scroll speed, px per frame (decays): above a few screens per frame the user is flinging.+ pub(crate) fling: f64,+ pub(crate) last_dir: i8,+ pub(crate) frames: u32,+ pub(crate) requested: Option<std::ops::Range<usize>>,+ pub(crate) more_to_measure: bool,+}++impl ListView {+ /// A view over `src` in a viewport `width` x `height`.+ pub fn new<S: ItemSource, M: Measurer>(src: &S, m: &M, width: f32, height: f32, opts: Options) -> Result<Self, IndexError> {+ let index = HeightIndex::estimated(src.len(), m.estimator(width.max(1.0)), |r| src.bytes(r))?;+ Ok(Self {+ index,+ text: TextLayout::new(opts.cache_capacity),+ page: Page::new(),+ page_version: u64::MAX,+ ahead: Page::new(),+ pos: if opts.start_at_end && opts.stick_to_bottom { Pos::Bottom } else { Pos::Anchor { item: 0, off: 0 } },+ goal: None,+ width,+ height,+ opts,+ placed: Vec::new(),+ updates: Vec::new(),+ samples: Vec::new(),+ pending: 0.0,+ fling: 0.0,+ last_dir: 1,+ frames: 0,+ requested: None,+ more_to_measure: false,+ })+ .map(|mut v| {+ if opts.start_at_end && !opts.stick_to_bottom {+ v.scroll_to_end();+ }+ v+ })+ }++ /// A view over equal-height items (`n` rows of `h` px): no estimates, no measuring.+ pub fn uniform<M: Measurer>(n: usize, h: f64, m: &M, width: f32, height: f32, opts: Options) -> Result<Self, IndexError> {+ let index = HeightIndex::uniform(n, crate::fx::Fx::from_px(h), m.estimator(width.max(1.0)))?;+ let mut v = Self::new(&crate::source::VecSource::new(), m, width, height, opts)?;+ v.index = index;+ if opts.start_at_end {+ v.scroll_to_end();+ }+ Ok(v)+ }++ #[must_use]+ pub const fn index(&self) -> &HeightIndex {+ &self.index+ }++ #[must_use]+ pub const fn pos(&self) -> Pos {+ self.pos+ }++ #[must_use]+ pub const fn viewport(&self) -> (f32, f32) {+ (self.width, self.height)+ }++ /// The items placed by the last [`ListView::layout`].+ #[must_use]+ pub fn placed(&self) -> &[Placed] {+ &self.placed+ }++ /// The id of the anchor item, which stays put when everything above changes.+ #[must_use]+ pub fn anchor_id<S: ItemSource>(&self, src: &S) -> Option<u64> {+ match self.pos {+ Pos::Anchor { item, .. } => src.id_at(item),+ Pos::Bottom => src.id_at(self.index.len().checked_sub(1)?),+ }+ }++ pub(crate) fn view_units(&self) -> u64 {+ px_to_units(f64::from(self.height))+ }++ /// Whether the viewport is pinned to the end.+ #[must_use]+ pub const fn at_bottom(&self) -> bool {+ matches!(self.pos, Pos::Bottom)+ }++ /// The scroll position and the content height in px (estimates for what+ /// is not measured: the scrollbar's inputs).+ #[must_use]+ pub fn scroll_extent(&self) -> (f64, f64) {+ let total = self.index.total();+ let top = match self.pos {+ Pos::Anchor { item, off } => self.index.offset_of(item) + off,+ Pos::Bottom => total.saturating_sub(self.view_units()),+ };+ (units_to_px(top), units_to_px(total))+ }++ // -- scrolling ------------------------------------------------------------------------------------------++ /// Scroll to absolute offset `abs` (fixed-point units from the top).+ pub(crate) fn set_scroll_units(&mut self, abs: u64) {+ let max = self.index.total().saturating_sub(self.view_units());+ if abs >= max && self.opts.stick_to_bottom {+ self.pos = Pos::Bottom;+ } else if let Some(l) = self.index.locate(abs.min(max)) {+ self.pos = Pos::Anchor { item: l.item, off: l.within };+ }+ }++ /// Scroll by `dy` px (positive: towards the end). NaN is ignored.+ pub fn scroll_by(&mut self, dy: f64) {+ if !dy.is_finite() || dy == 0.0 {+ return;+ }+ self.goal = None;+ self.last_dir = if dy > 0.0 { 1 } else { -1 };+ self.fling = self.fling.mul_add(0.85, dy.abs());+ let (top, total) = self.scroll_extent();+ let target = (top + dy).clamp(0.0, total);+ // stay exactly at the end when the end was reached (no estimate wobble)+ self.set_scroll_units(px_to_units(target));+ }++ /// Scroll to a fraction `0..=1` of the content (the scrollbar thumb being dragged).+ pub fn scroll_to_fraction(&mut self, f: f64) {+ if f.is_nan() {+ return;+ }+ self.goal = None;+ let max = self.index.total().saturating_sub(self.view_units());+ self.set_scroll_units((max as f64 * f.clamp(0.0, 1.0)) as u64);+ }++ /// The end of the list, at the bottom of the viewport.+ pub fn scroll_to_end(&mut self) {+ self.goal = None;+ self.set_scroll_units(u64::MAX / 2);+ if !self.opts.stick_to_bottom {+ self.pos = self.bottom_anchor();+ }+ }++ /// Bring `item` to `align` in the viewport. The target is re-aimed each+ /// frame until it is measured, so estimates between here and there+ /// cannot leave it off.+ pub fn jump_to(&mut self, item: usize, align: Align) {+ if self.index.is_empty() {+ return;+ }+ let item = item.min(self.index.len() - 1);+ self.pending = 0.0;+ self.goal = Some((item, align));+ self.pos = self.goal_pos(item, align);+ }++ /// [`ListView::jump_to`] by stable id; false when the id is unknown.+ pub fn jump_to_id<S: ItemSource>(&mut self, src: &S, id: u64, align: Align) -> bool {+ src.index_of(id).map(|i| self.jump_to(i, align)).is_some()+ }++ pub(crate) fn goal_pos(&self, item: usize, align: Align) -> Pos {+ let top = self.index.offset_of(item);+ let h = self.index.height_of(item).map_or(0, |(h, _)| u64::from(h.units()));+ let view = self.view_units();+ let abs = match align {+ Align::Start => top,+ Align::Center => (top + h / 2).saturating_sub(view / 2),+ Align::End => (top + h).saturating_sub(view),+ };+ let max = self.index.total().saturating_sub(view);+ if abs >= max && self.opts.stick_to_bottom && align != Align::Start {+ return Pos::Bottom;+ }+ self.index.locate(abs.min(max)).map_or(Pos::Anchor { item: 0, off: 0 }, |l| Pos::Anchor { item: l.item, off: l.within })+ }++ /// The anchor that puts the end of the list at the bottom edge.+ pub(crate) fn bottom_anchor(&self) -> Pos {+ let view = self.view_units();+ let n = self.index.len();+ if n == 0 {+ return Pos::Anchor { item: 0, off: 0 };+ }+ let mut acc = 0u64;+ let mut found = Pos::Anchor { item: 0, off: 0 };+ self.index.walk_backward(n - 1, |i, h, _| {+ acc += u64::from(h.units());+ if acc >= view {+ found = Pos::Anchor { item: i, off: acc - view };+ return false;+ }+ true+ });+ found+ }++ /// Keyboard navigation.+ pub fn navigate(&mut self, nav: Nav, line_px: f64) {+ let page = (f64::from(self.height) - line_px).max(line_px);+ match nav {+ Nav::LineUp => self.scroll_by(-line_px),+ Nav::LineDown => self.scroll_by(line_px),+ Nav::PageUp => self.scroll_by(-page),+ Nav::PageDown => self.scroll_by(page),+ Nav::Home => self.jump_to(0, Align::Start),+ Nav::End => self.scroll_to_end(),+ }+ }++ /// A wheel or trackpad delta. Precise deltas (a trackpad) apply at once;+ /// notched wheel deltas ease in over a few frames ([`ListView::tick`]).+ pub fn wheel(&mut self, dy: f64, precise: bool) {+ if precise {+ self.scroll_by(dy);+ } else if dy.is_finite() {+ self.pending += dy;+ }+ }++ /// Advance the smooth scroll by `dt` seconds. Returns whether another+ /// frame is needed (false when idle: no frames while nothing moves).+ pub fn tick(&mut self, dt: f64) -> bool {+ if self.pending == 0.0 {+ return self.more_to_measure;+ }+ let step = if self.pending.abs() < 0.5 { self.pending } else { self.pending * (1.0 - (-dt.max(0.0) / 0.075).exp()) };+ self.pending -= step;+ self.scroll_by(step);+ if self.pending.abs() < 0.01 {+ self.pending = 0.0;+ }+ true+ }++ /// Resize the viewport. A new width wraps text differently, so every+ /// measured height becomes an estimate again ([`HeightIndex::set_estimator`])+ /// and the anchor keeps its fraction of its item: what the user looks at+ /// stays at the top.+ pub fn resize<M: Measurer>(&mut self, m: &M, width: f32, height: f32) {+ self.height = height;+ if (width - self.width).abs() > f32::EPSILON {+ self.width = width;+ self.restyle(m);+ }+ }++ /// The measurer's style changed (font, size, metrics): forget every+ /// wrapped text and measured height; the anchor keeps its fraction of its item.+ pub fn restyle<M: Measurer>(&mut self, m: &M) {+ let before = match self.pos {+ Pos::Anchor { item, .. } => self.index.height_of(item).map(|(h, _)| u64::from(h.units())),+ Pos::Bottom => None,+ };+ let est = m.estimator(self.width.max(1.0));+ self.text.clear();+ self.index.set_estimator(est.with_text_width(est.text_width));+ self.page_version = u64::MAX;+ if let (Pos::Anchor { item, off }, Some(old)) = (&mut self.pos, before)+ && let Some((h, _)) = self.index.height_of(*item)+ {+ *off = (u128::from(*off) * u128::from(h.units()) / u128::from(old.max(1))) as u64;+ }+ }++ /// The placed item under viewport `y`.+ #[must_use]+ pub fn item_at(&self, y: f32) -> Option<usize> {+ self.placed.iter().find(|p| y >= p.y && y < p.y + p.h).map(|p| p.item)+ }++ /// Whether the user is flinging (loads wait, measuring is budgeted).+ #[must_use]+ pub fn flinging(&self) -> bool {+ self.fling > f64::from(self.height) * 2.0+ }+}diff --git a/bindings/rust/blenderui-vlist/src/wrap.rs b/bindings/rust/blenderui-vlist/src/wrap.rsnew file mode 100644index 0000000..0bf0282--- /dev/null+++ b/bindings/rust/blenderui-vlist/src/wrap.rs@@ -0,0 +1,174 @@+//! Wrapping text to a width, once per `(text, width, style)`.+//!+//! Blender wraps a console line on the spot with `textview_wrap_offsets`+//! (`editors/space_info/textview.cc`): one pass over the code points,+//! counting columns, recording the byte offset where each line starts. This+//! is the same pass in pixels, with two additions: the result is cached by+//! the caller ([`crate::measure::TextLayout`]), and ASCII (nearly all chat)+//! is measured with a per-byte advance table filled lazily from the host's+//! text measurement, so a message costs a table lookup per byte instead of+//! a call into the shaper. Other characters are measured one by one by the+//! host (and remembered); the host still shapes the finished lines when it+//! paints.++use std::collections::HashMap;++/// Where each line of a wrapped text starts (the first, at 0, is implicit).+#[derive(Clone, Debug, Default, PartialEq, Eq)]+pub struct Lines {+ starts: Box<[u32]>,+}++impl Lines {+ /// One line (no allocation).+ #[must_use]+ pub fn one() -> Self {+ Self::default()+ }++ #[must_use]+ pub fn count(&self) -> usize {+ self.starts.len() + 1+ }++ /// Line `i` of `text` without its trailing newline.+ #[must_use]+ pub fn line<'a>(&self, text: &'a str, i: usize) -> &'a str {+ let a = if i == 0 { 0 } else { self.starts[i - 1] as usize };+ let b = self.starts.get(i).map_or(text.len(), |&b| b as usize);+ text[a..b].trim_end_matches(['\n', '\r'])+ }+}++/// Advance widths at one font size: ASCII in a table, the rest in a map.+pub struct Advances {+ size: f32,+ ascii: [f32; 128],+ other: HashMap<char, f32>,+}++impl Default for Advances {+ fn default() -> Self {+ Self { size: 0.0, ascii: [f32::NAN; 128], other: HashMap::new() }+ }+}++impl Advances {+ /// Forget everything when the size (or the font) changes.+ pub fn reset(&mut self, size: f32) {+ self.size = size;+ self.ascii = [f32::NAN; 128];+ self.other.clear();+ }++ #[must_use]+ pub const fn size(&self) -> f32 {+ self.size+ }++ fn of(&mut self, c: char, tw: &mut dyn FnMut(&str, f32) -> f32) -> f32 {+ let mut buf = [0u8; 4];+ let size = self.size;+ let mut measure = |c: char| tw(c.encode_utf8(&mut buf), size).max(0.0);+ if c.is_ascii() {+ let slot = &mut self.ascii[c as usize];+ if slot.is_nan() {+ *slot = measure(c);+ }+ *slot+ } else {+ *self.other.entry(c).or_insert_with(|| measure(c))+ }+ }+}++/// Wrap `text` to `max_w` px: break after spaces, at newlines, and inside a+/// word only when the word alone is wider than the line.+pub fn wrap(text: &str, max_w: f32, adv: &mut Advances, tw: &mut dyn FnMut(&str, f32) -> f32) -> Lines {+ let mut starts: Vec<u32> = Vec::new();+ let (mut line_w, mut line_start) = (0.0f32, 0usize);+ // the best place to break: byte offset after the last space, and the width up to it+ let mut brk: Option<(usize, f32)> = None;+ for (i, c) in text.char_indices() {+ if c == '\n' {+ starts.push((i + 1) as u32);+ (line_w, line_start, brk) = (0.0, i + 1, None);+ continue;+ }+ let w = adv.of(c, tw);+ if c == ' ' || c == '\t' {+ // trailing blanks may hang past the edge+ line_w += w;+ brk = Some((i + 1, line_w));+ continue;+ }+ if line_w + w > max_w && i > line_start {+ match brk {+ Some((at, w_at)) if at > line_start => {+ starts.push(at as u32);+ line_start = at;+ line_w -= w_at;+ }+ _ => {+ starts.push(i as u32);+ line_start = i;+ line_w = 0.0;+ }+ }+ brk = None;+ }+ line_w += w;+ }+ Lines { starts: starts.into_boxed_slice() }+}++#[cfg(test)]+mod tests {+ use super::*;++ fn tw(s: &str, size: f32) -> f32 {+ s.chars().count() as f32 * size * 0.5+ }++ fn run(text: &str, w: f32) -> Vec<String> {+ let mut adv = Advances::default();+ adv.reset(10.0);+ let l = wrap(text, w, &mut adv, &mut |s, z| tw(s, z));+ (0..l.count()).map(|i| l.line(text, i).to_owned()).collect()+ }++ #[test]+ fn short_text_is_one_line() {+ assert_eq!(run("hello", 100.0), ["hello"]);+ assert_eq!(run("", 100.0), [""]);+ }++ #[test]+ fn breaks_after_spaces() {+ // 5 px per char: 10 chars per 50 px line+ assert_eq!(run("aaaa bbbb cccc dddd", 50.0), ["aaaa bbbb ", "cccc dddd"]);+ }++ #[test]+ fn long_word_breaks_inside() {+ assert_eq!(run("abcdefghijklmno", 50.0), ["abcdefghij", "klmno"]);+ }++ #[test]+ fn newlines_are_hard_breaks() {+ assert_eq!(run("a\nb\n\nc", 50.0), ["a", "b", "", "c"]);+ }++ #[test]+ fn unicode_is_measured_by_the_host() {+ assert_eq!(run("héllo wörld", 30.0), ["héllo ", "wörld"]);+ }++ #[test]+ fn every_line_but_the_unbreakable_fits() {+ let text = "the quick brown fox jumps over the lazy dog ".repeat(20);+ for l in run(&text, 120.0) {+ assert!(tw(l.trim_end(), 10.0) <= 120.0, "{l:?}");+ }+ }+}diff --git a/bindings/rust/blenderui-vlist/tests/view.rs b/bindings/rust/blenderui-vlist/tests/view.rsnew file mode 100644index 0000000..a7daf6f--- /dev/null+++ b/bindings/rust/blenderui-vlist/tests/view.rs@@ -0,0 +1,372 @@+//! The view end to end on synthetic chat data: anchors, bottom pinning,+//! jumps, resize, budgets, the file-backed log, and allocation counts.++#![allow(clippy::float_cmp)]++use blenderui_paint::testing::{count_allocs, Counting};+use blenderui_paint::{PaintSink, Palette, Rect, Rgba};+use blenderui_vlist::source::{ItemSource, Page};+use blenderui_vlist::synth;+use blenderui_vlist::{Align, Budget, ChatList, ChatStyle, ListView, Options, Pos};++#[global_allocator]+static A: Counting = Counting;++fn tw(s: &str, size: f32) -> f32 {+ s.chars().count() as f32 * size * 0.5+}++fn chat(n: u64, opts: Options) -> ChatList {+ ChatList::from_messages(synth::messages(0, n), Palette::blender_dark(), 600.0, 400.0, opts)+}++fn end_y(c: &ChatList) -> f32 {+ let p = c.view.placed().last().unwrap();+ p.y + p.h+}++/// A sink that counts calls and draws nothing.+#[derive(Default)]+struct Null {+ calls: usize,+}++impl PaintSink for Null {+ fn fill(&mut self, _: Rect, _: Rgba) {+ self.calls += 1;+ }+ fn stroke(&mut self, _: Rect, _: Rgba, _: f32) {+ self.calls += 1;+ }+ fn round(&mut self, _: Rect, _: f32, _: Rgba) {+ self.calls += 1;+ }+ fn line(&mut self, _: (f32, f32), _: (f32, f32), _: Rgba, _: f32) {+ self.calls += 1;+ }+ fn text(&mut self, _: f32, _: f32, _: &str, _: f32, _: Rgba) {+ self.calls += 1;+ }+ fn text_width(&mut self, t: &str, size: f32) -> f32 {+ tw(t, size)+ }+ fn clipped(&mut self, _: Rect, f: &mut dyn FnMut(&mut dyn PaintSink)) {+ f(self);+ }+}++#[test]+fn first_frame_fills_the_viewport_from_the_top() {+ let mut c = chat(1000, Options::default());+ let placed = c.layout(&mut tw).to_vec();+ assert_eq!(placed[0].item, 0);+ assert_eq!(placed[0].y, 0.0);+ assert!(end_y(&c) >= 400.0);+ assert!(placed.iter().all(|p| p.exact), "unlimited budget measures everything shown");+ for w in placed.windows(2) {+ assert!((w[0].y + w[0].h - w[1].y).abs() < 0.01, "items are contiguous");+ }+}++#[test]+fn opens_at_the_newest_item_touching_only_the_tail() {+ let mut c = chat(200_000, Options { start_at_end: true, ..Options::default() });+ c.layout(&mut tw);+ assert_eq!(c.view.placed().last().unwrap().item, 199_999);+ assert!((end_y(&c) - 400.0).abs() < 0.01);+ assert!(c.view.index().measured_items() <= 1100, "{}", c.view.index().measured_items());+ assert!(c.view.at_bottom());+}++#[test]+fn heights_changing_above_the_viewport_do_not_move_it() {+ let mut c = chat(50_000, Options::default());+ c.view.jump_to(25_000, Align::Start);+ c.layout(&mut tw);+ let before: Vec<_> = c.view.placed().iter().map(|p| (p.item, p.y)).collect();+ // an image arrives above, a block is re-measured above+ c.view.set_known_height(24_990, 500.0);+ c.view.changed(24_000);+ c.view.set_known_height(10, 900.0);+ c.layout(&mut tw);+ let after: Vec<_> = c.view.placed().iter().map(|p| (p.item, p.y)).collect();+ assert_eq!(before, after);+ // below: the anchor item stays+ c.view.set_known_height(25_005, 700.0);+ c.layout(&mut tw);+ assert_eq!((c.view.placed()[0].item, c.view.placed()[0].y), before[0]);+}++#[test]+fn prepending_history_does_not_jump() {+ let mut c = ChatList::from_messages(synth::messages(1000, 3000), Palette::blender_dark(), 600.0, 400.0, Options::default());+ c.view.jump_to(500, Align::Start);+ c.view.scroll_by(7.0);+ c.layout(&mut tw);+ let id = c.view.anchor_id(&c.source);+ let first = (c.view.placed()[0].item, c.view.placed()[0].y);+ c.prepend(synth::messages(0, 1000));+ c.layout(&mut tw);+ assert_eq!(c.view.anchor_id(&c.source), id);+ assert_eq!(c.view.placed()[0].item, first.0 + 1000);+ assert!((c.view.placed()[0].y - first.1).abs() < 0.01);+ assert_eq!(c.source.len(), 3000);+}++#[test]+fn stick_to_bottom_follows_until_the_user_scrolls_up() {+ let mut c = chat(500, Options { start_at_end: true, ..Options::default() });+ c.layout(&mut tw);+ assert!(c.view.at_bottom());+ c.push(synth::message(500));+ c.layout(&mut tw);+ assert_eq!(c.view.placed().last().unwrap().item, 500);+ assert!((end_y(&c) - 400.0).abs() < 0.01, "follows the new message");+ // scroll up: stops following+ c.view.scroll_by(-120.0);+ c.layout(&mut tw);+ assert!(!c.view.at_bottom());+ let id = c.view.anchor_id(&c.source);+ c.push(synth::message(501));+ c.layout(&mut tw);+ assert_eq!(c.view.anchor_id(&c.source), id, "still where the user left it");+ assert!(c.view.placed().last().unwrap().item < 501);+ // back to the bottom: follows again+ c.view.scroll_by(1e9);+ c.layout(&mut tw);+ assert!(c.view.at_bottom());+ c.push(synth::message(502));+ c.layout(&mut tw);+ assert_eq!(c.view.placed().last().unwrap().item, 502);+}++#[test]+fn streaming_growth_of_the_last_message_stays_pinned() {+ let mut c = chat(300, Options { start_at_end: true, ..Options::default() });+ c.layout(&mut tw);+ let mut text = String::new();+ let mut last_h = 0.0;+ for k in 0..60 {+ text.push_str("tokens keep arriving and the message keeps growing ");+ c.edit(299, &text);+ c.layout(&mut tw);+ assert!((end_y(&c) - 400.0).abs() < 0.01, "step {k}");+ let h = c.view.placed().last().unwrap().h;+ assert!(h >= last_h);+ last_h = h;+ }+ assert!(last_h > 100.0);+}++#[test]+fn deleting_in_the_middle_keeps_the_anchor() {+ let mut c = chat(5000, Options::default());+ c.view.jump_to(2000, Align::Start);+ c.layout(&mut tw);+ let id = c.view.anchor_id(&c.source);+ c.remove(100);+ c.layout(&mut tw);+ assert_eq!(c.view.anchor_id(&c.source), id);+ // deleting the anchor item itself: the next item takes its place+ let at = match c.view.pos() {+ Pos::Anchor { item, .. } => item,+ Pos::Bottom => unreachable!(),+ };+ c.remove(at);+ c.layout(&mut tw);+ assert_eq!(c.view.placed()[0].item, at);+ assert_eq!(c.source.len(), 4998);+}++#[test]+fn resize_invalidates_heights_and_keeps_the_reader_in_place() {+ let mut c = chat(20_000, Options::default());+ c.view.jump_to(8000, Align::Start);+ c.layout(&mut tw);+ let id = c.view.anchor_id(&c.source);+ assert!(c.view.index().measured_items() > 0);+ c.resize(300.0, 400.0);+ assert_eq!(c.view.index().measured_items(), 0, "measured heights were for the old width");+ c.layout(&mut tw);+ assert_eq!(c.view.anchor_id(&c.source), id);+ assert!(c.view.placed().iter().all(|p| p.exact));+ assert!(c.view.placed().iter().map(|p| p.h).sum::<f32>() >= 400.0);+}++#[test]+fn jump_converges_on_the_target() {+ let mut c = chat(300_000, Options::default());+ for (item, align) in [(123_456usize, Align::Center), (200_000, Align::End), (7, Align::Start), (299_999, Align::End)] {+ c.view.jump_to(item, align);+ for _ in 0..4 {+ c.layout(&mut tw);+ }+ let p = c.view.placed().iter().find(|p| p.item == item).copied().unwrap_or_else(|| panic!("{item} not shown"));+ assert!(p.exact);+ match align {+ Align::Start => assert!(p.y.abs() < 0.5, "{p:?}"),+ Align::Center => assert!((p.y + p.h * 0.5 - 200.0).abs() < 2.0, "{p:?}"),+ Align::End => assert!((p.y + p.h - 400.0).abs() < 2.0, "{p:?}"),+ }+ }+}++#[test]+fn a_fling_draws_skeletons_within_the_budget_then_catches_up() {+ let mut c = chat(100_000, Options { fling_budget: Budget::Items(2), ..Options::default() });+ c.layout(&mut tw);+ c.view.scroll_by(1.0e5);+ c.view.scroll_by(1.0e5);+ assert!(c.view.flinging());+ c.layout(&mut tw);+ let skeletons = c.view.placed().iter().filter(|p| !p.exact).count();+ assert!(skeletons > 0, "the budget left some unmeasured");+ let mut sink = Null::default();+ c.paint(&mut sink);+ assert!(sink.calls > 0);+ for _ in 0..40 {+ c.layout(&mut tw);+ }+ assert!(c.view.placed().iter().all(|p| p.exact));+}++#[test]+fn idle_prefetch_measures_ahead_of_the_scroll() {+ let mut c = chat(20_000, Options::default());+ c.layout(&mut tw);+ let last = c.view.placed().last().unwrap().item;+ assert!(!c.view.index().height_of(last + 20).unwrap().1, "not measured yet");+ let mut rounds = 0;+ while c.prefetch(&mut tw, Budget::Items(10)) && rounds < 100 {+ rounds += 1;+ }+ assert!(c.view.index().height_of(last + 20).unwrap().1, "measured ahead");+ assert!(c.view.index().height_of(last + 1).unwrap().1);+}++#[test]+fn wheel_eases_and_goes_idle() {+ let mut c = chat(2000, Options::default());+ c.layout(&mut tw);+ c.view.wheel(300.0, false);+ let mut frames = 0;+ while c.view.tick(1.0 / 60.0) {+ c.layout(&mut tw);+ frames += 1;+ assert!(frames < 500);+ }+ assert!(frames > 3, "eased over several frames");+ let (top, _) = c.view.scroll_extent();+ assert!((top - 300.0).abs() < 1.0, "{top}");+ assert!(!c.view.tick(1.0 / 60.0), "idle: no more frames");+}++#[test]+fn hostile_inputs() {+ let mut c = chat(0, Options::default());+ assert!(c.layout(&mut tw).is_empty());+ c.view.scroll_by(f64::NAN);+ c.view.scroll_by(f64::INFINITY);+ c.view.jump_to(usize::MAX, Align::Center);+ c.view.scroll_to_fraction(f64::NAN);+ c.view.wheel(f64::NAN, false);+ let mut c = chat(10, Options::default());+ c.view.jump_to(usize::MAX, Align::End);+ c.view.scroll_by(f64::MAX);+ c.view.scroll_by(-f64::MAX);+ c.layout(&mut tw);+ c.resize(0.0, 0.0);+ c.layout(&mut tw);+ c.resize(f32::NAN, 100.0);+ c.layout(&mut tw);+ assert_eq!(c.view.index().len(), 10);+}++#[test]+fn a_source_changed_behind_the_view_is_resynced() {+ let mut c = chat(1000, Options::default());+ c.layout(&mut tw);+ c.source.push(synth::message(1000));+ c.layout(&mut tw);+ assert_eq!(c.view.index().len(), 1001);+}++#[test]+fn the_estimate_converges_as_the_user_scrolls() {+ let mut c = chat(100_000, Options::default());+ c.layout(&mut tw);+ let (_, first_total) = c.view.scroll_extent();+ for _ in 0..400 {+ c.view.scroll_by(350.0);+ c.layout(&mut tw);+ }+ let (_, later) = c.view.scroll_extent();+ // the true total, measured the slow way+ let style = c.style.clone();+ let mut layout = blenderui_vlist::TextLayout::new(1 << 20);+ let mut page = Page::new();+ c.source.fetch(0..100_000, &mut page);+ let mut real = 0.0f64;+ for i in 0..100_000 {+ real += layout.height(&page.record(i).unwrap(), &style, 600.0, &mut tw).px();+ }+ let (e0, e1) = ((first_total - real).abs() / real, (later - real).abs() / real);+ assert!(e1 < 0.08, "estimate off by {e1:.3} after scrolling (first guess {e0:.3})");+}++#[test]+fn log_source_round_trips_messages() {+ let dir = std::env::temp_dir().join(format!("bui-vlist-log-{}", std::process::id()));+ std::fs::create_dir_all(&dir).unwrap();+ let base = dir.join("chat");+ let msgs = synth::messages(0, 5000);+ let mut w = blenderui_vlist::log::LogWriter::create(&base).unwrap();+ for m in &msgs {+ w.append(m).unwrap();+ }+ w.finish().unwrap();+ let src = blenderui_vlist::log::LogSource::open(&base).unwrap();+ assert_eq!(src.len(), 5000);+ let mut page = Page::new();+ src.fetch(1234..1300, &mut page);+ for (i, m) in msgs.iter().enumerate().take(1300).skip(1234) {+ let r = page.record(i).unwrap();+ assert_eq!((r.id, r.time, r.sender, r.flags, r.text), (m.id, m.time, m.sender, m.flags, m.text.as_str()), "{i}");+ assert_eq!(r.media_h, m.media_h / 4 * 4);+ }+ let want: u64 = msgs[10..4000].iter().map(|m| m.text.len() as u64).sum();+ assert_eq!(src.bytes(10..4000), want);+ assert_eq!(src.index_of(77), Some(76));+ let style = ChatStyle::new(Palette::blender_dark());+ let mut v = ListView::new(&src, &style, 600.0, 400.0, Options { start_at_end: true, ..Options::default() }).unwrap();+ assert_eq!(v.layout(&src, &style, &mut tw).last().unwrap().item, 4999);+ std::fs::remove_dir_all(&dir).unwrap();+}++#[test]+fn steady_state_frames_do_not_allocate() {+ let mut c = chat(50_000, Options::default());+ c.view.jump_to(20_000, Align::Start);+ let mut sink = Null::default();+ for _ in 0..6 {+ c.layout(&mut tw);+ c.paint(&mut sink);+ }+ let n = count_allocs(|| {+ for k in 0..30 {+ c.view.scroll_by(if k % 2 == 0 { 2.0 } else { -2.0 });+ c.layout(&mut tw);+ c.paint(&mut sink);+ }+ });+ assert_eq!(n, 0, "a steady frame allocated");+}++#[test]+fn a_uniform_list_needs_no_measuring() {+ let style = ChatStyle::new(Palette::blender_dark());+ let mut v = ListView::uniform(10_000_000, 24.0, &style, 600.0, 480.0, Options::default()).unwrap();+ v.scroll_by(1.0e8);+ assert!(v.index().heap_bytes() < 2_000_000);+ assert_eq!(v.index().measured_items(), 0);+}diff --git a/bindings/rust/blenderui/Cargo.toml b/bindings/rust/blenderui/Cargo.tomlindex cdabe06..578ad7e 100644--- a/bindings/rust/blenderui/Cargo.toml+++ b/bindings/rust/blenderui/Cargo.toml@@ -16,6 +16,8 @@ readme = "README.md"include = ["src/**", "tests/**", "examples/**", "README.md", "Cargo.toml"][dependencies]+blenderui-table = { path = "../blenderui-table", version = "0.2.0" }+blenderui-vlist = { path = "../blenderui-vlist", version = "0.2.0" }blenderui-sys = { path = "../blenderui-sys", version = "0.2.0", default-features = false }blenderui-macros = { path = "../blenderui-macros", version = "0.2.0" }blenderui-tailwind = { path = "../blenderui-tailwind", version = "0.2.0" }diff --git a/bindings/rust/blenderui/examples/bench_table.rs b/bindings/rust/blenderui/examples/bench_table.rsnew file mode 100644index 0000000..af90473--- /dev/null+++ b/bindings/rust/blenderui/examples/bench_table.rs@@ -0,0 +1,189 @@+//! Data table benchmark: 1,000,000 rows x 20 columns, painted `DataTable`+//! vs `uniform_list` rows of cell elements vs a naive element per row.+//!+//! ```text+//! cargo run --release --example bench_table -j 1+//! ```+//! Prints one JSON-ish line per measurement (ms per frame is the whole+//! pipeline: render, layout, paint and the software raster of 900x500 px).++use std::alloc::{GlobalAlloc, Layout, System};+use std::cell::Cell;+use std::time::Instant;++use blenderui::prelude::*;+use blenderui::table::{Cell as TableCell, CellSource, Column, DataTable, TableDelegate, TableState};++struct Counting;+thread_local! { static COUNT: Cell<usize> = const { Cell::new(0) }; }+// SAFETY: forwards to the system allocator; the counter is a const thread-local.+unsafe impl GlobalAlloc for Counting {+ unsafe fn alloc(&self, l: Layout) -> *mut u8 {+ COUNT.set(COUNT.get() + 1);+ unsafe { System.alloc(l) }+ }+ unsafe fn dealloc(&self, p: *mut u8, l: Layout) {+ unsafe { System.dealloc(p, l) }+ }+}+#[global_allocator]+static A: Counting = Counting;++#[cfg(windows)]+fn rss_mb() -> f64 {+ #[repr(C)]+ struct Pmc { cb: u32, fc: u32, peak: usize, ws: usize, a: usize, b: usize, c: usize, d: usize, e: usize, f: usize }+ unsafe extern "system" {+ fn GetCurrentProcess() -> isize;+ fn K32GetProcessMemoryInfo(h: isize, p: *mut Pmc, cb: u32) -> i32;+ }+ let mut m = Pmc { cb: std::mem::size_of::<Pmc>() as u32, fc: 0, peak: 0, ws: 0, a: 0, b: 0, c: 0, d: 0, e: 0, f: 0 };+ // SAFETY: a correctly sized, writable PROCESS_MEMORY_COUNTERS.+ unsafe { K32GetProcessMemoryInfo(GetCurrentProcess(), &mut m, m.cb) };+ m.ws as f64 / 1048576.0+}+#[cfg(not(windows))]+fn rss_mb() -> f64 {+ std::fs::read_to_string("/proc/self/statm").ok()+ .and_then(|s| s.split_whitespace().nth(1)?.parse::<f64>().ok()).map_or(0.0, |p| p * 4096.0 / 1048576.0)+}++const COLS: usize = 20;+const ROWS: usize = 1_000_000;++struct Big;+impl CellSource for Big {+ fn cell(&self, row: usize, col: usize) -> TableCell<'_> {+ TableCell::U64(cell(row, col))+ }+}++impl TableDelegate for Big {+ fn columns_count(&self, _: &App) -> usize {+ COLS+ }+ fn rows_count(&self, _: &App) -> usize {+ ROWS+ }+ fn column(&self, ix: usize, _: &App) -> Column {+ Column::new(format!("c{ix}"), format!("Column {ix}")).sortable().width(px(100.0))+ }+}++fn cell(r: usize, c: usize) -> u64 {+ (r as u64).wrapping_mul(2_654_435_761).wrapping_add(c as u64 * 40_503) % 1_000_003+}++struct Painted(Entity<TableState<Big>>);+impl Render for Painted {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ body().m_0().child(div().w(px(900.0)).h(px(500.0)).child(DataTable::new(&self.0).stripe(true)))+ }+}++/// `n` rows of 20 cell elements each in a `uniform_list` (gpui's way).+struct Listed(usize);+impl Render for Listed {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ body().m_0().child(+ uniform_list("rows", self.0, |range, _, _| {+ range.map(|r| div().flex().children((0..COLS).map(move |c| div().w(px(100.0)).child(cell(r, c).to_string()))))+ .collect::<Vec<_>>()+ })+ .item_height(px(20.0)).w(px(900.0)).h(px(500.0)),+ )+ }+}++/// `n` rows as plain elements in a scroll container (no virtualization).+struct Naive(usize);+impl Render for Naive {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ body().m_0().child(+ div().id("naive").overflow_y_scroll().w(px(900.0)).h(px(500.0)).children((0..self.0).map(|r| {+ div().flex().h(px(20.0)).children((0..COLS).map(move |c| div().w(px(100.0)).child(cell(r, c).to_string())))+ })),+ )+ }+}++fn opts() -> WindowOptions {+ WindowOptions {+ window_bounds: Some(WindowBounds::Windowed(Bounds { origin: point(px(0.0), px(0.0)), size: size(px(900.0), px(500.0)) })),+ ..Default::default()+ }+}++fn ms(t: Instant) -> f64 {+ t.elapsed().as_secs_f64() * 1000.0+}++fn main() {+ let which = std::env::args().nth(1).unwrap_or_else(|| "all".into());+ let base = rss_mb();+ if which == "all" || which == "painted" {+ Application::headless().run(|cx| {+ let t0 = Instant::now();+ let mut table = None;+ let win = cx.open_window(opts(), |w, cx| {+ let t = cx.new(|cx| TableState::new(Big, w, cx).row_header(true));+ table = Some(t);+ cx.new(|_| Painted(t))+ }).unwrap();+ let t = table.unwrap();+ let build = ms(t0);+ let t1 = Instant::now();+ cx.draw(win.id);+ cx.draw(win.id);+ let first = ms(t1);+ let frames = 300;+ COUNT.set(0);+ let t2 = Instant::now();+ for _ in 0..frames {+ t.update(cx, |s, _| s.scroll_by(0.0, 37.0));+ cx.notify_all();+ cx.draw(win.id);+ }+ let per = ms(t2) / f64::from(frames);+ let allocs = COUNT.get() / frames as usize;+ // sort by a column through a header click: an index permutation of 1M rows+ let t3 = Instant::now();+ cx.simulate_click(win.id, 100.0, 10.0);+ let sort = ms(t3);+ println!("painted rows={ROWS} cols={COLS} build_ms={build:.2} first_frame_ms={first:.2} scroll_frame_ms={per:.3} \+ allocs_per_full_frame={allocs} sort_click_ms={sort:.1} rss_delta_mb={:.1}", rss_mb() - base);+ });+ }+ for (name, n, rows) in [("uniform_list", 1usize, ROWS), ("naive_2000", 2usize, 2000), ("naive_20000", 2usize, 20_000)] {+ if which != "all" && which != name {+ continue;+ }+ let base = rss_mb();+ Application::headless().run(move |cx| {+ let t0 = Instant::now();+ let win = if n == 1 {+ cx.open_window(opts(), |_, cx| cx.new(|_| Listed(rows))).unwrap().id+ } else {+ cx.open_window(opts(), |_, cx| cx.new(|_| Naive(rows))).unwrap().id+ };+ cx.draw(win);+ cx.draw(win);+ let first = ms(t0);+ let frames = if n == 1 { 100 } else { 10 };+ COUNT.set(0);+ let t2 = Instant::now();+ for k in 0..frames {+ let id = if n == 1 { "rows" } else { "naive" };+ if let Some(w) = cx.window(win) {+ let (_, y) = w.scroll_offset(id);+ let _ = (y, k);+ }+ cx.simulate_scroll(win, 100.0, 100.0, -1);+ cx.draw(win);+ }+ let per = ms(t2) / f64::from(frames);+ println!("{name} rows={rows} cols={COLS} first_frame_ms={first:.1} scroll_frame_ms={per:.2} \+ allocs_per_frame={} rss_delta_mb={:.1}", COUNT.get() / frames as usize, rss_mb() - base);+ });+ }+}diff --git a/bindings/rust/blenderui/examples/site_chat.rs b/bindings/rust/blenderui/examples/site_chat.rsnew file mode 100644index 0000000..0a8b332--- /dev/null+++ b/bindings/rust/blenderui/examples/site_chat.rs@@ -0,0 +1,71 @@+//! A chat with a million messages in Blender's theme: variable heights from+//! wrapped text and images, run headers, date dividers, opens at the newest+//! message, follows new ones while at the bottom, whole-message selection.+//!+//! ```text+//! cargo run --release --example site_chat+//! ```++#[path = "site/common.rs"]+mod common;++use blenderui::prelude::*;+use blenderui::vlist::{chat_list, synth, theme_palette, ChatList, ChatStyle, ItemSource, ListState, Options, VecSource};++const MESSAGES: u64 = 1_000_000;++struct Page {+ chat: Entity<ListState<VecSource, ChatStyle>>,+}++impl Render for Page {+ fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {+ let (n, shown) = {+ let s = self.chat.read(cx);+ let p = s.view.placed();+ (s.source.len(), p.first().zip(p.last()).map(|(a, b)| (a.item, b.item)))+ };+ let shown = shown.map_or_else(String::new, |(a, b)| format!("showing {a}..{b}"));+ if std::env::var_os("CHAT_TRACE").is_some() {+ eprintln!("{:?} {shown}", std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map(|d| d.as_millis() % 100_000).unwrap_or(0));+ }+ html().styled().size_full().child(+ body().m_0().size_full().child(+ // fills the window: the list takes what the status bar leaves+ div().flex().flex_col().size_full()+ .child(div().flex_1().min_h(px(0.0)).child(chat_list(&self.chat)))+ .child(+ div().flex().items_center().h(px(24.0)).px_2().gap_4().text_size(px(12.0))+ .child(format!("{n} messages"))+ .child(shown),+ ),+ ),+ )+ }+}++fn main() {+ let shot = common::screenshot_arg();+ let app = if shot.is_some() { Application::headless() } else { Application::new() };+ app.run(move |cx| {+ let win = cx+ .open_window(common::options(760.0, 460.0, "Chat"), |_, cx| {+ // a screenshot only needs the newest page; the live window holds the lot+ let n = if shot.is_some() { 20_000 } else { MESSAGES };+ let opts = Options { start_at_end: true, ..Options::default() };+ let chat = cx.new(|cx| ListState::new(ChatList::from_messages(synth::messages(0, n), theme_palette(), 760.0, 436.0, opts), cx));+ cx.new(|_| Page { chat })+ })+ .unwrap();+ if let Some(path) = shot {+ for _ in 0..3 {+ cx.draw(win.id);+ }+ // select a message the way a click does+ cx.simulate_click(win.id, 300.0, 380.0);+ cx.draw(win.id);+ let (w, h, px) = cx.draw(win.id);+ common::save(&path, w, h, &px);+ }+ });+}diff --git a/bindings/rust/blenderui/examples/site_data_table.rs b/bindings/rust/blenderui/examples/site_data_table.rsnew file mode 100644index 0000000..ef34f24--- /dev/null+++ b/bindings/rust/blenderui/examples/site_data_table.rs@@ -0,0 +1,123 @@+//! A one-million-row data table in Blender's theme: virtualized, sortable,+//! resizable columns, a pinned column, row selection and a status line.+//!+//! ```text+//! cargo run --release --example site_data_table+//! ```++#[path = "site/common.rs"]+mod common;++use blenderui::prelude::*;+use blenderui::table::{Cell, CellSource, Column, ColumnSort, DataTable, TableDelegate, TableState};++const ROWS: usize = 1_000_000;+const NAMES: [&str; 8] = ["Cube", "Sphere", "Suzanne", "Torus", "Cone", "Plane", "Cylinder", "Icosphere"];+const MATERIALS: [&str; 6] = ["Principled BSDF", "Emission", "Glass BSDF", "Diffuse", "Glossy", "Toon"];+const STATUS: [&str; 4] = ["Ready", "Baking", "Modified", "Linked"];++/// Cells are computed from the row number: nothing is stored per row.+struct Meshes;++fn hash(r: usize, salt: u64) -> u64 {+ let mut x = (r as u64 + 1).wrapping_mul(0x9E37_79B9_7F4A_7C15) ^ salt.wrapping_mul(0xD6E8_FEB8_6659_FD93);+ x ^= x >> 29;+ x.wrapping_mul(0xBF58_476D_1CE4_E5B9) >> 20+}++impl CellSource for Meshes {+ fn cell(&self, row: usize, col: usize) -> Cell<'_> {+ match col {+ 0 => Cell::U64(row as u64),+ 1 => Cell::Str(NAMES[hash(row, 1) as usize % NAMES.len()]),+ 2 => Cell::Str(MATERIALS[hash(row, 2) as usize % MATERIALS.len()]),+ 3 => Cell::U64(hash(row, 3) % 900_000 + 8),+ 4 => Cell::U64(hash(row, 3) % 900_000 / 2 + 6),+ 5 => Cell::F64((hash(row, 5) % 90_000) as f64 / 100.0, 2),+ _ => Cell::Str(STATUS[hash(row, 6) as usize % STATUS.len()]),+ }+ }+}++impl TableDelegate for Meshes {+ fn columns_count(&self, _: &App) -> usize {+ 7+ }+ fn rows_count(&self, _: &App) -> usize {+ ROWS+ }+ fn column(&self, ix: usize, _: &App) -> Column {+ match ix {+ 0 => Column::new("id", "ID").sortable().width(px(84.0)).fixed_left().text_right(),+ 1 => Column::new("name", "Object").sortable().width(px(150.0)),+ 2 => Column::new("material", "Material").sortable().width(px(140.0)),+ 3 => Column::new("verts", "Vertices").sortable().width(px(100.0)).text_right(),+ 4 => Column::new("faces", "Faces").sortable().width(px(90.0)).text_right(),+ 5 => Column::new("size", "Size (MB)").sortable().width(px(100.0)).text_right(),+ _ => Column::new("status", "Status").sortable().width(px(110.0)),+ }+ }+}++struct Page {+ table: Entity<TableState<Meshes>>,+}++impl Render for Page {+ fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {+ let (rows, selected, vis, sort) = {+ let s = self.table.read(cx);+ (s.rows(), s.selected_rows().count(), s.visible_range().rows().clone(), s.sorted_by())+ };+ let sorted = match sort {+ Some((c, ColumnSort::Descending)) => format!("sorted by column {c}, descending"),+ Some((c, _)) => format!("sorted by column {c}, ascending"),+ None => "unsorted".to_string(),+ };+ html().styled().child(+ body().m_0().child(+ div().flex().flex_col().w(px(760.0)).h(px(460.0))+ .child(div().h(px(436.0)).child(DataTable::new(&self.table).stripe(true)))+ .child(+ div().flex().items_center().h(px(24.0)).px_2().gap_4().text_size(px(12.0))+ .child(format!("{rows} rows"))+ .child(format!("showing {}..{}", vis.start, vis.end))+ .child(format!("{selected} selected"))+ .child(sorted),+ ),+ ),+ )+ }+}++fn main() {+ let shot = common::screenshot_arg();+ let app = if shot.is_some() { Application::headless() } else { Application::new() };+ app.run(move |cx| {+ let win = cx+ .open_window(common::options(760.0, 460.0, "Data table"), |window, cx| {+ let table = cx.new(|cx| TableState::new(Meshes, window, cx).row_header(true));+ if shot.is_some() {+ // a state worth a picture: sorted, a few rows selected, scrolled a little+ table.update(cx, |s, c| {+ s.sort_by(3, ColumnSort::Descending, window, c);+ let row = s.row_at(2);+ s.set_selected_row(row, c);+ });+ }+ cx.new(|_| Page { table })+ })+ .unwrap();+ if let Some(path) = shot {+ for _ in 0..3 {+ cx.draw(win.id);+ }+ // shift-click extends the selection like in Blender's lists+ cx.simulate_click(win.id, 300.0, 100.0);+ cx.simulate_click_with(win.id, 300.0, 140.0, false, true);+ cx.draw(win.id);+ let (w, h, px) = cx.draw(win.id);+ common::save(&path, w, h, &px);+ }+ });+}diff --git a/bindings/rust/blenderui/src/element.rs b/bindings/rust/blenderui/src/element.rsindex df86d8f..43c21d0 100644--- a/bindings/rust/blenderui/src/element.rs+++ b/bindings/rust/blenderui/src/element.rs@@ -18,8 +18,36 @@ pub type ElementId = SharedString;/// An event listener, owned by its element (moved into the frame, never shared).pub(crate) type Listener<E> = Box<dyn Fn(&E, &mut Window, &mut App)>;+/// Work an element postpones until the window can lend itself: it receives+/// the window and app and finishes the element (children, styles) in place.+pub(crate) type Deferred = Box<dyn FnOnce(&mut Window, &mut App, &mut Div)>;++thread_local! {+ /// Deferred elements built since the last [`resolve_deferred`].+ static DEFERRED: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };+}++/// Finish every deferred element of `el` (parents first, so what a deferred+/// element adds is resolved too). Costs nothing when none were built.+pub(crate) fn resolve_deferred(el: &mut AnyElement, window: &mut Window, app: &mut App) {+ if DEFERRED.replace(0) == 0 {+ return;+ }+ fn walk(el: &mut AnyElement, window: &mut Window, app: &mut App) {+ if let AnyElement::Element(d) = el {+ if let Some(f) = d.deferred.take() {+ f(window, app, d);+ }+ for c in &mut d.children {+ walk(c, window, app);+ }+ }+ }+ walk(el, window, app);+}+/// Custom painting (gpui's `canvas()` element).-pub(crate) type PaintFn = Box<dyn Fn(crate::geometry::Bounds<f32>, &mut crate::paint::Painter)>;+pub(crate) type PaintFn = Box<dyn Fn(crate::geometry::Bounds<f32>, &mut crate::paint::Painter, &App)>;#[derive(Default)]pub(crate) struct Listeners {@@ -49,6 +77,8 @@ pub struct Div {pub(crate) listeners: Option<Box<Listeners>>,pub(crate) paint: Option<PaintFn>,pub(crate) image: Option<Arc<crate::paint::Image>>,+ /// Runs before layout with the window and app (see [`Div::defer`]).+ pub(crate) deferred: Option<Deferred>,}/// Styles for interaction states (`.hover(|s| ...)` ...).@@ -110,9 +140,23 @@ impl Div {listeners: None,paint: None,image: None,+ deferred: None,}}+ /// Finish this element later, when the window is at hand: `f` runs+ /// once, after the view returned and before layout, and may add+ /// children and styles. Virtualized elements ([`uniform_list`], the data+ /// tables) use it to build only what their last-known size and scroll+ /// offset show.+ ///+ /// [`uniform_list`]: crate::uniform_list+ pub(crate) fn defer(mut self, f: impl FnOnce(&mut Window, &mut App, &mut Div) + 'static) -> Self {+ self.deferred = Some(Box::new(f));+ DEFERRED.set(DEFERRED.get() + 1);+ self+ }+fn listeners_mut(&mut self) -> &mut Listeners {self.listeners.get_or_insert_with(Default::default)}@@ -379,6 +423,16 @@ impl FluentBuilder for StyleRefinement {}/// gpui's `canvas(prepaint, paint)`: an element that paints itself.pub fn canvas(paint: impl Fn(crate::geometry::Bounds<f32>, &mut crate::paint::Painter) + 'static)+ -> Div {+ let mut d = Div::new("canvas");+ d.paint = Some(Box::new(move |b, p, _| paint(b, p)));+ d+}++/// Like [`canvas`], and the paint callback also reads the app: a view over+/// an entity paints straight from it (`entity.read(cx)`) with nothing copied+/// into the element tree. The data tables draw this way.+pub fn canvas_with(paint: impl Fn(crate::geometry::Bounds<f32>, &mut crate::paint::Painter, &App) + 'static)-> Div {let mut d = Div::new("canvas");d.paint = Some(Box::new(paint));diff --git a/bindings/rust/blenderui/src/geometry.rs b/bindings/rust/blenderui/src/geometry.rsindex 802d7a1..9506287 100644--- a/bindings/rust/blenderui/src/geometry.rs+++ b/bindings/rust/blenderui/src/geometry.rs@@ -164,3 +164,9 @@ impl Mul<f32> for Pixels {Pixels(self.0 * k)}}++impl From<Pixels> for f32 {+ fn from(p: Pixels) -> Self {+ p.0+ }+}diff --git a/bindings/rust/blenderui/src/lib.rs b/bindings/rust/blenderui/src/lib.rsindex 605a4ae..6d480b3 100644--- a/bindings/rust/blenderui/src/lib.rs+++ b/bindings/rust/blenderui/src/lib.rs@@ -105,6 +105,10 @@ pub mod element;pub mod events;pub mod geometry;pub mod html;+pub mod list;+pub mod table;+pub(crate) mod sink;+pub mod vlist;pub(crate) mod layout;pub mod paint;pub(crate) mod prof;@@ -123,6 +127,7 @@ pub use blenderui_sys as sys;pub use color::*;pub use element::*;+pub use list::{uniform_list, UniformList};pub use events::*;pub use geometry::{point, px, relative, rems, size, Bounds, Length, Pixels, Point, Rems, Size};pub use paint::{Image, Painter};@@ -212,6 +217,7 @@ pub mod prelude {Button, Checkbox, ColorSwatch, Dropdown, NumberField, NumberSlider, ProgressBar, Radio, TextArea, TextField,};pub use crate::element::*;+ pub use crate::list::{uniform_list, UniformList};pub use crate::events::*;pub use crate::geometry::{point, px, relative, rems, size, Bounds, Length, Pixels, Point, Rems, Size};pub use crate::html::*;diff --git a/bindings/rust/blenderui/src/list.rs b/bindings/rust/blenderui/src/list.rsnew file mode 100644index 0000000..dbff266--- /dev/null+++ b/bindings/rust/blenderui/src/list.rs@@ -0,0 +1,98 @@+//! [`uniform_list`]: gpui's virtualized list of equal-height items.+//!+//! Only the items in view (plus a little overscan) become elements: the+//! visible range comes from the same math Blender's spreadsheet uses+//! ([`visible_rows`], `get_visible_rows` in `spreadsheet_draw.cc`). The+//! container scrolls like any `overflow: scroll` element, its offset kept+//! per element id, and a spacer as tall as every item together gives the+//! scrollbar the full extent. The cost of a frame is O(visible items).+//!+//! Heights are `f32` layout pixels: past about 16 million pixels of content+//! (a million 24 px rows) the scroll offset loses sub-pixel precision. The+//! [`DataTable`](crate::table::DataTable) keeps its own `f64` offset and has+//! no such limit.++use std::ops::Range;++use crate::css::Decl;+use crate::element::{AnyElement, Div, ElementId, IntoElement, ParentElement};+use crate::html::div;+use blenderui_table::{clamp_scroll, visible_rows};+use crate::{px, App, Styled, Window};++type ItemFn = Box<dyn Fn(Range<usize>, &mut Window, &mut App) -> Vec<AnyElement>>;++/// Items drawn beyond the edges, so a fast scroll doesn't show gaps.+const OVERSCAN: usize = 2;++/// A virtualized list (gpui's `uniform_list(id, item_count, |range, window, cx| ...)`).+///+/// ```ignore+/// uniform_list("rows", 1_000_000, |range, _window, _cx| {+/// range.map(|i| div().child(format!("Row {i}"))).collect::<Vec<_>>()+/// })+/// .h(px(300.0))+/// ```+pub fn uniform_list<R: IntoElement>(+ id: impl Into<ElementId>,+ item_count: usize,+ f: impl Fn(Range<usize>, &mut Window, &mut App) -> Vec<R> + 'static,+) -> UniformList {+ let id = id.into();+ UniformList {+ base: div().id(id.clone()).overflow_y_scroll(),+ id,+ count: item_count,+ item_h: None,+ f: Box::new(move |r, w, cx| f(r, w, cx).into_iter().map(IntoElement::into_any_element).collect()),+ }+}++/// See [`uniform_list`].+pub struct UniformList {+ base: Div,+ id: ElementId,+ count: usize,+ item_h: Option<f32>,+ f: ItemFn,+}++impl UniformList {+ /// Every item's height. Defaults to Blender's `UI_UNIT_Y` (one widget+ /// row at the current UI scale).+ pub fn item_height(mut self, h: impl Into<crate::Pixels>) -> Self {+ self.item_h = Some(h.into().0);+ self+ }+}++impl Styled for UniformList {+ fn decls_mut(&mut self) -> &mut Vec<Decl> {+ self.base.decls_mut()+ }+}++impl IntoElement for UniformList {+ fn into_any_element(self) -> AnyElement {+ let UniformList { base, id, count, item_h, f } = self;+ AnyElement::Element(base.defer(move |window, cx, el| {+ let item_h = item_h.unwrap_or_else(|| window.ui_unit()).max(1.0);+ let bounds = window.bounds_of(&id);+ let view_h = bounds.map_or_else(|| window.viewport_size().height.0, |b| b.size.height);+ let scroll = clamp_scroll(+ f64::from(window.scroll_offset(&id).1), count, f64::from(item_h), f64::from(view_h));+ let r = visible_rows(scroll, f64::from(item_h), f64::from(view_h), count);+ let range = r.start.saturating_sub(OVERSCAN)..(r.end + OVERSCAN).min(count);+ let items = if range.is_empty() { Vec::new() } else { f(range.clone(), window, cx) };+ let mut at = div().absolute().left(px(0.0)).right(px(0.0)).top(px(range.start as f32 * item_h));+ for it in items {+ at = at.child(div().h(px(item_h)).overflow_hidden().child(it));+ }+ let spacer = div().relative().w_full().flex_none().h(px(count as f32 * item_h)).child(at);+ el.children.push(AnyElement::Element(spacer));+ if bounds.is_none() {+ window.refresh(); // first frame: lay out once to learn the height+ }+ }))+ }+}diff --git a/bindings/rust/blenderui/src/paint.rs b/bindings/rust/blenderui/src/paint.rsindex 4a36fce..b044fd7 100644--- a/bindings/rust/blenderui/src/paint.rs+++ b/bindings/rust/blenderui/src/paint.rs@@ -101,13 +101,17 @@ enum Coords {}impl Coords {- fn of(v: &[f32]) -> Coords {- if v.len() <= 4 {+ /// Points flattened to x, y pairs; up to two stay inline (no allocation).+ fn of_points(points: &[(f32, f32)]) -> Coords {+ if points.len() <= 2 {let mut a = [0.0; 4];- a[..v.len()].copy_from_slice(v);- Coords::Inline(a, v.len() as u8)+ for (k, &(x, y)) in points.iter().enumerate() {+ a[k * 2] = x;+ a[k * 2 + 1] = y;+ }+ Coords::Inline(a, (points.len() * 2) as u8)} else {- Coords::Heap(v.to_vec())+ Coords::Heap(points.iter().flat_map(|&(x, y)| [x, y]).collect())}}@@ -203,14 +207,12 @@ impl Painter {/// A polyline through `points`.pub fn line(&mut self, points: &[(f32, f32)], color: impl Into<Rgba>, width: f32) {- let v: Vec<f32> = points.iter().flat_map(|&(x, y)| [x, y]).collect();- self.push(Kind::Line { width }, Coords::of(&v), color.into());+ self.push(Kind::Line { width }, Coords::of_points(points), color.into());}/// A filled polygon (gpui's `paint_path`).pub fn polygon(&mut self, points: &[(f32, f32)], color: impl Into<Rgba>) {- let v: Vec<f32> = points.iter().flat_map(|&(x, y)| [x, y]).collect();- self.push(Kind::Polygon, Coords::of(&v), color.into());+ self.push(Kind::Polygon, Coords::of_points(points), color.into());}/// A pie slice: degrees counter-clockwise from 3 o'clock.@@ -419,7 +421,7 @@ fn radius_px(c: &Computed, b: Bounds<f32>, vp: (f32, f32)) -> f32 {/// Paint every box of `frame`, in stacking order. `scale`: device pixels/// per logical pixel (for elements whose effects work on pixels).pub(crate) fn paint_frame(frame: &Frame, styles: &StyleStore, tc: &mut TextCache, p: &mut Painter,- vp: (f32, f32), scale: f32) {+ vp: (f32, f32), scale: f32, app: &crate::window::App) {let mut order: Vec<usize> = (0..frame.nodes.len()).collect();if frame.nodes.iter().any(|n| styles[n.style].z_index.is_some()) {order.sort_by_key(|&i| frame.z_of(i, styles)); // stable: tree order within a level@@ -433,10 +435,10 @@ pub(crate) fn paint_frame(frame: &Frame, styles: &StyleStore, tc: &mut TextCache}p.opacity = n.opacity;p.clip = n.clip;- paint_node(frame, styles, tc, i, p, vp);+ paint_node(frame, styles, tc, i, p, vp, app);}} else {- let mut cx = LayerCx { frame, styles, tc, vp, scale, done: vec![false; frame.nodes.len()] };+ let mut cx = LayerCx { frame, styles, tc, vp, scale, app, done: vec![false; frame.nodes.len()] };paint_list(&mut cx, &order, p, None, 1.0);LAYERS.with(|l| l.borrow_mut().end_frame());}@@ -450,6 +452,7 @@ struct LayerCx<'a> {tc: &'a mut TextCache,vp: (f32, f32),scale: f32,+ app: &'a crate::window::App,done: Vec<bool>,}@@ -522,7 +525,7 @@ fn paint_list(cx: &mut LayerCx, list: &[usize], p: &mut Painter, root: Option<usp.opacity = (n.opacity / base.max(1e-6)).min(1.0);p.clip = n.clip;let (frame, styles, vp) = (cx.frame, cx.styles, cx.vp);- paint_node(frame, styles, cx.tc, i, p, vp);+ paint_node(frame, styles, cx.tc, i, p, vp, cx.app);}}@@ -812,7 +815,7 @@ fn redundant_background(frame: &Frame, styles: &StyleStore, n: &BoxNode) -> bool}fn paint_node(frame: &Frame, styles: &StyleStore, tc: &mut TextCache, i: usize, p: &mut Painter,- vp: (f32, f32)) {+ vp: (f32, f32), app: &crate::window::App) {let n = &frame.nodes[i];let c = &styles[n.style];let b = n.bounds;@@ -895,7 +898,7 @@ fn paint_node(frame: &Frame, styles: &StyleStore, tc: &mut TextCache, i: usize,}_ => p.image(inner, img),},- Replaced::Painted(f) => p.with_clip(inner, |p| f(inner, p)),+ Replaced::Painted(f) => p.with_clip(inner, |p| f(inner, p, app)),Replaced::Placeholder(tag) => {p.fill(inner, crate::color::rgb(0x282828));let label = frame.attr(i, "alt").unwrap_or(tag);diff --git a/bindings/rust/blenderui/src/sink.rs b/bindings/rust/blenderui/src/sink.rsnew file mode 100644index 0000000..44f5b7b--- /dev/null+++ b/bindings/rust/blenderui/src/sink.rs@@ -0,0 +1,108 @@+//! The blenderui side of painting, shared by every core-driven view (the+//! data table, the variable list): a [`PaintSink`] that appends to the+//! engine's display list ([`Painter`]), the theme palette, and a text-width+//! cache. The views' painting itself lives in the framework-independent+//! cores; this is the one place that knows how a core's calls become engine+//! calls.++use std::cell::Cell as StdCell;++use blenderui_sys as sys;+use blenderui_table::{PaintSink, Palette, Rect, Rgba as CoreRgba, TextCache};++use crate::color::Rgba;+use crate::geometry::{Bounds, Point, Size};+use crate::Painter;++fn theme(key: &std::ffi::CStr) -> CoreRgba {+ let mut c = [0.0f32; 4];+ // SAFETY: `c` holds the four floats the kit writes; `key` is NUL-terminated.+ unsafe { sys::BK_theme_color(key.as_ptr(), c.as_mut_ptr()) };+ CoreRgba::new(c[0], c[1], c[2], c[3])+}++/// The views' colors from the kit's theme.+pub(crate) fn current_palette() -> Palette {+ Palette::new(theme(c"region_bg"), theme(c"text"), theme(c"file_row_alternate"), theme(c"list_item.inner_sel"), theme(c"list_item.item"))+}++const fn color(c: CoreRgba) -> Rgba {+ Rgba { r: c.r, g: c.g, b: c.b, a: c.a }+}++fn bounds(r: Rect, origin: Point<f32>) -> Bounds<f32> {+ Bounds { origin: Point { x: origin.x + r.x, y: origin.y + r.y }, size: Size { width: r.w, height: r.h } }+}++/// Text widths at one scale; dropped when the scale changes.+struct Widths {+ scale: f32,+ cache: TextCache<f32>,+}++thread_local! {+ /// Kept across frames: a scrolling view shows mostly the same strings.+ static WIDTHS: StdCell<Option<Widths>> = const { StdCell::new(None) };+}++/// Width of `s` at `size` logical px, measured by the text engine at the+/// device size it is drawn at.+pub(crate) fn measure(s: &str, size: f32, scale: f32) -> f32 {+ let (fam, low) = crate::text::family(0);+ let mut w = 0.0f32;+ // SAFETY: pointers valid for the call; `family` returns static strings.+ let ok = unsafe { sys::BUI_text_measure(fam, low, size * scale, s.as_ptr().cast(), s.len() as i32, &mut w) };+ if ok == 0 { s.chars().count() as f32 * size * 0.55 } else { w / scale }+}++/// Top of a text item of `size` px whose line box is centered on `cy`.+fn text_top(cy: f32, size: f32) -> f32 {+ let base = crate::text::baseline(cy - size * 0.5, size, size);+ crate::text::item_top(base, size)+}++/// Draws into a [`Painter`] at `origin`.+pub(crate) struct PainterSink<'a> {+ p: &'a mut Painter,+ origin: Point<f32>,+ scale: f32,+ widths: &'a mut TextCache<f32>,+}++/// Run `f` with a sink drawing into `p` at `origin` (logical px, at device `scale`).+pub(crate) fn with_sink<R>(p: &mut Painter, origin: Point<f32>, scale: f32, f: impl FnOnce(&mut PainterSink<'_>) -> R) -> R {+ let scale = scale.max(f32::MIN_POSITIVE);+ let mut w = WIDTHS.take().filter(|w| w.scale == scale).unwrap_or_else(|| Widths { scale, cache: TextCache::new(20_000) });+ w.cache.next_generation();+ let r = f(&mut PainterSink { p, origin, scale, widths: &mut w.cache });+ WIDTHS.set(Some(w));+ r+}++impl PaintSink for PainterSink<'_> {+ fn fill(&mut self, r: Rect, c: CoreRgba) {+ self.p.fill(bounds(r, self.origin), color(c));+ }+ fn stroke(&mut self, r: Rect, c: CoreRgba, width: f32) {+ self.p.quad(bounds(r, self.origin), 0.0, Rgba::TRANSPARENT, color(c), width);+ }+ fn round(&mut self, r: Rect, radius: f32, c: CoreRgba) {+ self.p.quad(bounds(r, self.origin), radius, color(c), Rgba::TRANSPARENT, 0.0);+ }+ fn line(&mut self, a: (f32, f32), b: (f32, f32), c: CoreRgba, width: f32) {+ let o = self.origin;+ self.p.line(&[(a.0 + o.x, a.1 + o.y), (b.0 + o.x, b.1 + o.y)], color(c), width);+ }+ fn text(&mut self, x: f32, cy: f32, text: &str, size: f32, c: CoreRgba) {+ self.p.text(self.origin.x + x, text_top(self.origin.y + cy, size), text, size, color(c));+ }+ fn text_width(&mut self, text: &str, size: f32) -> f32 {+ let scale = self.scale;+ *self.widths.get_or_insert_with(text, 0, size, || measure(text, size, scale))+ }+ fn clipped(&mut self, r: Rect, f: &mut dyn FnMut(&mut dyn PaintSink)) {+ let (origin, scale) = (self.origin, self.scale);+ let widths = &mut *self.widths;+ self.p.with_clip(bounds(r, origin), |p| f(&mut PainterSink { p, origin, scale, widths }));+ }+}diff --git a/bindings/rust/blenderui/src/table/data_table.rs b/bindings/rust/blenderui/src/table/data_table.rsnew file mode 100644index 0000000..919978b--- /dev/null+++ b/bindings/rust/blenderui/src/table/data_table.rs@@ -0,0 +1,223 @@+//! [`DataTable`]: the element that shows a [`TableState`] (gpui-component's+//! `DataTable::new(&state)`).+//!+//! It is one painted leaf (a canvas drawn from the state, see+//! [`super::draw`]) inside a wrapper that takes pointer and keyboard input,+//! plus a few invisible handles over the header borders that give the+//! column-resize cursor. A frame therefore builds a constant number of+//! elements however many rows there are, and paints O(visible cells).++use std::rc::Rc;++use blenderui_table::{ColumnSort, TableEvent};+use super::delegate::TableDelegate;+use super::state::TableState;+use blenderui_table::Size;+use crate::element::{canvas_with, Div};+use crate::html::div;+use crate::css::Decl;+use crate::{px, AnyElement, App, Entity, IntoElement, MouseButton, ParentElement, Pixels, Styled, Window};++type Listener = Box<dyn Fn(&TableEvent, &mut Window, &mut App)>;++/// A table element.+///+/// ```ignore+/// let table = cx.new(|cx| TableState::new(MyDelegate::new(), window, cx));+/// // in render:+/// div().size_full().child(DataTable::new(&table).stripe(true).on_select(|row, _, _| println!("{row}")))+/// ```+pub struct DataTable<D: TableDelegate> {+ state: Entity<TableState<D>>,+ base: Div,+ stripe: Option<bool>,+ bordered: Option<bool>,+ size: Option<Size>,+ header_h: Option<f32>,+ fixed_border: Option<bool>,+ scrollbars: Option<(bool, bool)>,+ listeners: Vec<Listener>,+}++impl<D: TableDelegate> DataTable<D> {+ pub fn new(state: &Entity<TableState<D>>) -> Self {+ Self {+ state: *state,+ base: div().relative().overflow_hidden().size_full(),+ stripe: None,+ bordered: None,+ size: None,+ header_h: None,+ fixed_border: None,+ scrollbars: None,+ listeners: Vec::new(),+ }+ }++ /// Tint every second row (Blender's `draw_alternating_row_overlay`).+ pub fn stripe(mut self, on: bool) -> Self {+ self.stripe = Some(on);+ self+ }+ pub fn bordered(mut self, on: bool) -> Self {+ self.bordered = Some(on);+ self+ }+ pub fn size(mut self, size: Size) -> Self {+ self.size = Some(size);+ self+ }+ pub fn header_row_height(mut self, h: impl Into<Pixels>) -> Self {+ self.header_h = Some(h.into().0);+ self+ }+ pub fn fixed_cols_border(mut self, on: bool) -> Self {+ self.fixed_border = Some(on);+ self+ }+ pub fn scrollbar_visible(mut self, vertical: bool, horizontal: bool) -> Self {+ self.scrollbars = Some((vertical, horizontal));+ self+ }++ /// Every table event.+ pub fn on_event(mut self, f: impl Fn(&TableEvent, &mut Window, &mut App) + 'static) -> Self {+ self.listeners.push(Box::new(f));+ self+ }+ /// A row was selected (delegate row index).+ pub fn on_select(self, f: impl Fn(usize, &mut Window, &mut App) + 'static) -> Self {+ self.on_event(move |e, w, cx| {+ if let TableEvent::SelectRow(r) = e {+ f(*r, w, cx);+ }+ })+ }+ /// A row was double clicked.+ pub fn on_row_double_click(self, f: impl Fn(usize, &mut Window, &mut App) + 'static) -> Self {+ self.on_event(move |e, w, cx| {+ if let TableEvent::DoubleClickedRow(r) = e {+ f(*r, w, cx);+ }+ })+ }+ /// A header click sorted a column (delegate column index).+ pub fn on_sort(self, f: impl Fn(usize, ColumnSort, &mut Window, &mut App) + 'static) -> Self {+ self.on_event(move |e, w, cx| {+ if let TableEvent::Sorted(c, s) = e {+ f(*c, *s, w, cx);+ }+ })+ }+ /// A column was resized (all widths, view order).+ pub fn on_column_resize(self, f: impl Fn(&[Pixels], &mut Window, &mut App) + 'static) -> Self {+ self.on_event(move |e, w, cx| {+ if let TableEvent::ColumnWidthsChanged(v) = e {+ let widths: Vec<Pixels> = v.iter().map(|&w| Pixels(w)).collect();+ f(&widths, w, cx);+ }+ })+ }+ /// A right click on a row (`None`: on empty space).+ pub fn on_context_menu(self, f: impl Fn(Option<usize>, &mut Window, &mut App) + 'static) -> Self {+ self.on_event(move |e, w, cx| {+ if let TableEvent::RightClickedRow(r) = e {+ f(*r, w, cx);+ }+ })+ }+}++impl<D: TableDelegate> Styled for DataTable<D> {+ fn decls_mut(&mut self) -> &mut Vec<Decl> {+ self.base.decls_mut()+ }+}++/// Hand the state's pending events to the listeners.+fn dispatch<D: TableDelegate>(state: Entity<TableState<D>>, ls: &[Listener], window: &mut Window, cx: &mut App) {+ let events = state.update(cx, |s, _| s.take_events());+ for e in &events {+ for l in ls {+ l(e, window, cx);+ }+ }+}++impl<D: TableDelegate> IntoElement for DataTable<D> {+ fn into_any_element(self) -> AnyElement {+ let DataTable { state, base, stripe, bordered, size, header_h, fixed_border, scrollbars, listeners } = self;+ let ls: Rc<[Listener]> = listeners.into();+ let el = base.defer(move |window, cx, el| {+ let (id, mut o) = {+ let s = state.read(cx);+ (s.id.clone(), s.opts)+ };+ if let Some(v) = stripe { o.stripe = v }+ if let Some(v) = bordered { o.bordered = v }+ if let Some(v) = size { o.size = v }+ if let Some(v) = fixed_border { o.fixed_cols_border = v }+ if let Some(v) = scrollbars { o.scrollbars = v }+ o.header_row_height = header_h.or(o.header_row_height);+ let known = window.bounds_of(&id);+ let bounds = known.unwrap_or_default();+ let (unit, scale) = (window.ui_unit(), window.scale_factor());+ let handles = state.update(cx, |s, c| {+ s.opts = o;+ let changed = known.is_none() || s.bounds != bounds || (s.unit() - unit).abs() > f32::EPSILON;+ s.sync(bounds, unit, scale, window, c);+ if changed {+ window.refresh(); // placed for the first time or resized: draw once more with the new size+ }+ s.header_handles()+ });+ let (down, mv, up, wh, key) = (ls.clone(), ls.clone(), ls.clone(), ls.clone(), ls);+ let taken = std::mem::replace(el, Div::new("div"));+ let mut d = taken.id(id)+ .on_any_mouse_down(move |e, w, cx| {+ let (pos, b, m, n) = (crate::point(e.position.x.0, e.position.y.0), e.button, e.modifiers, e.click_count);+ state.update(cx, |s, c| s.mouse_down(pos, b, m, n, w, c));+ dispatch(state, &down, w, cx);+ })+ .on_mouse_move(move |e, w, cx| {+ let pos = crate::point(e.position.x.0, e.position.y.0);+ state.update(cx, |s, c| {+ if e.pressed_button.is_none() && s.dragging() {+ s.pointer_up(w, c);+ } else {+ s.mouse_move(pos, w, c);+ }+ });+ dispatch(state, &mv, w, cx);+ })+ .on_mouse_up(MouseButton::Left, move |_, w, cx| {+ state.update(cx, |s, c| s.pointer_up(w, c));+ dispatch(state, &up, w, cx);+ })+ .on_scroll_wheel(move |e, w, cx| {+ state.update(cx, |s, _| s.wheel(e.delta, e.modifiers.shift, w));+ dispatch(state, &wh, w, cx);+ })+ .on_key_down(move |e, w, cx| {+ state.update(cx, |s, c| s.key_down(e, w, c));+ dispatch(state, &key, w, cx);+ })+ .child(+ // the canvas alone in its layer: a percentage-sized canvas next to other+ // children is not laid out by the engine+ div().absolute().left(px(0.0)).top(px(0.0)).w_full().h_full()+ .child(canvas_with(move |b, p, cx| state.read(cx).draw(b, p)).size_full()),+ );+ for (x, y, h) in handles {+ d = d.child(div_handle(x, y, h));+ }+ *el = d;+ });+ AnyElement::Element(el)+ }+}++/// An invisible strip over a header border: only there for its cursor.+fn div_handle(x: f32, y: f32, h: f32) -> Div {+ div().absolute().left(px(x - 3.0)).top(px(y)).w(px(7.0)).h(px(h)).cursor_col_resize()+}diff --git a/bindings/rust/blenderui/src/table/delegate.rs b/bindings/rust/blenderui/src/table/delegate.rsnew file mode 100644index 0000000..4abac2f--- /dev/null+++ b/bindings/rust/blenderui/src/table/delegate.rs@@ -0,0 +1,100 @@+//! The data side of a table: [`TableDelegate`] (gpui-component's trait,+//! with Blender's data-source shape) and the core's [`VecTable`] as a delegate over+//! `Vec<Vec<String>>`.+//!+//! Blender's `DataSource` (`spreadsheet_data_source.hh`) answers+//! `tot_rows()` and hands out lazily evaluated columns; a cell is fetched+//! only when drawn. [`CellSource::cell`] (the supertrait, shared by every+//! framework adapter) is that contract: it is called for visible cells only,+//! and returns a borrowed `&str` or a number that the table formats into a+//! stack buffer, so drawing allocates nothing.++use blenderui_table::{CellSource, Column, ColumnGroup, ColumnSort, VecTable};++use super::state::TableState;+use crate::{App, Context, Pixels, Window};++/// Provides a table's columns and the hooks around it. Names and meaning+/// follow gpui-component's `TableDelegate`; the cells themselves come from+/// the [`CellSource`] supertrait (text drawn by the table: custom element+/// cells are not supported, which is what makes drawing O(visible cells)+/// with no element tree).+#[allow(unused_variables)]+pub trait TableDelegate: CellSource + Sized + 'static {+ /// Number of columns.+ fn columns_count(&self, cx: &App) -> usize;++ /// Number of rows.+ fn rows_count(&self, cx: &App) -> usize;++ /// The column at `col_ix`. Called when the table prepares or refreshes.+ fn column(&self, col_ix: usize, cx: &App) -> Column;++ /// Whether the table sorts a row index list ([`CellSource::sort_kind`],+ /// typed keys: no data is copied or moved) rather than leave sorting to+ /// [`perform_sort`](Self::perform_sort).+ fn sort_by_mask(&self) -> bool {+ true+ }++ /// The column was sorted (`sort`). With [`sort_by_mask`](Self::sort_by_mask)+ /// the table has already reordered its row index list; this is a+ /// notification. Otherwise sort your own data here.+ fn perform_sort(&mut self, col_ix: usize, sort: ColumnSort, window: &mut Window, cx: &mut Context<TableState<Self>>) {}++ /// The width column `col_ix` needs to show its content whole, for a+ /// double click on its header border. `None` changes nothing.+ fn fit_column(&mut self, col_ix: usize, window: &mut Window, cx: &mut Context<TableState<Self>>) -> Option<Pixels> {+ None+ }++ /// Column `col_ix` was dragged to index `to_ix` (the table keeps its own+ /// order; this is a notification, e.g. to persist it).+ fn move_column(&mut self, col_ix: usize, to_ix: usize, window: &mut Window, cx: &mut Context<TableState<Self>>) {}++ /// Group header rows above the column headers (outermost first).+ fn group_headers(&self, cx: &App) -> Option<Vec<Vec<ColumnGroup>>> {+ None+ }++ /// Show the loading skeleton instead of rows.+ fn loading(&self, cx: &App) -> bool {+ false+ }++ /// The text shown when there are no rows.+ fn empty_text(&self) -> &str {+ "No data"+ }++ /// More rows can be loaded when scrolling reaches the bottom.+ fn has_more(&self, cx: &App) -> bool {+ false+ }++ /// Remaining rows below the view that trigger [`load_more`](Self::load_more).+ fn load_more_threshold(&self) -> usize {+ 20+ }++ /// Load more rows (called when near the bottom and `has_more`).+ fn load_more(&mut self, window: &mut Window, cx: &mut Context<TableState<Self>>) {}++ /// The visible display rows changed. Keep it fast.+ fn visible_rows_changed(&mut self, visible_range: std::ops::Range<usize>, window: &mut Window, cx: &mut Context<TableState<Self>>) {}++ /// The visible columns (view indices) changed. Keep it fast.+ fn visible_columns_changed(&mut self, visible_range: std::ops::Range<usize>, window: &mut Window, cx: &mut Context<TableState<Self>>) {}+}++impl TableDelegate for VecTable {+ fn columns_count(&self, _: &App) -> usize {+ self.columns.len()+ }+ fn rows_count(&self, _: &App) -> usize {+ self.rows.len()+ }+ fn column(&self, col_ix: usize, _: &App) -> Column {+ self.columns[col_ix].clone()+ }+}diff --git a/bindings/rust/blenderui/src/table/mod.rs b/bindings/rust/blenderui/src/table/mod.rsnew file mode 100644index 0000000..7063c6c--- /dev/null+++ b/bindings/rust/blenderui/src/table/mod.rs@@ -0,0 +1,53 @@+//! A fast, virtualized data table, drawn the way Blender's spreadsheet+//! editor draws (`source/blender/editors/space_spreadsheet`), with the API+//! of gpui-component's `DataTable`.+//!+//! * [`TableDelegate`]: your data. Cells are fetched only when drawn+//! (Blender's `DataSource::get_column_values`), as typed [`Cell`]s.+//! * [`TableState`]: scroll, columns, sort, selection; an entity.+//! * [`DataTable`]: the element.+//!+//! Where it lives: everything that is not blenderui is in the+//! `blenderui-table` crate, once: the visible-row math, column culling, row+//! index masks and typed sorting, selection, keyboard navigation, column+//! layout and the painting itself ([`blenderui_table::paint_table`]). This+//! module is the adapter: the [`TableState`] entity around a+//! [`blenderui_table::TableModel`], the [`DataTable`] element that feeds it+//! input, and the paint sink that draws into the engine's display list+//! ([`sink`]). The gpui adapter (`blenderui-table-gpui`) shares all of that+//! core. The C kit's list/tree views (`kit_views.c`) are widget-tree views of+//! a few hundred rows with Blender's UI-list semantics and cannot share it+//! without rebuilding the engine on the C side.+//!+//! ```ignore+//! struct People;+//! impl CellSource for People {+//! fn cell(&self, row: usize, col: usize) -> Cell<'_> {+//! if col == 0 { Cell::U64(row as u64) } else { Cell::U64(row as u64 * 7) }+//! }+//! }+//! impl TableDelegate for People {+//! fn columns_count(&self, _: &App) -> usize { 2 }+//! fn rows_count(&self, _: &App) -> usize { 1_000_000 }+//! fn column(&self, ix: usize, _: &App) -> Column {+//! if ix == 0 { Column::new("id", "ID").sortable().width(px(80.0)) } else { Column::new("name", "Name") }+//! }+//! }+//! let table = cx.new(|cx| TableState::new(People, window, cx));+//! // in render+//! DataTable::new(&table).stripe(true)+//! ```++pub mod data_table;+pub mod delegate;+pub mod sink;+pub mod state;++pub use blenderui_table::{+ Cell, CellBuf, CellSource, Column, ColumnFixed, ColumnGroup, ColumnLayout, ColumnSort, RowMask, RowSelection, Size,+ SortKind, TableEvent, TableModel, TableOptions, TableSelection, TableVisibleRange, TextAlign, VecTable,+};+pub use blenderui_table::{clamp_scroll, max_scroll, scroll_to_show, visible_cols, visible_rows};+pub use data_table::DataTable;+pub use delegate::TableDelegate;+pub use state::TableState;diff --git a/bindings/rust/blenderui/src/table/sink.rs b/bindings/rust/blenderui/src/table/sink.rsnew file mode 100644index 0000000..a95db02--- /dev/null+++ b/bindings/rust/blenderui/src/table/sink.rs@@ -0,0 +1,117 @@+//! The table's painting entry: the shared sink ([`crate::sink`]) around+//! `blenderui_table::paint_table`.++use blenderui_table::{paint_table, with_scratch};++use super::delegate::TableDelegate;+use super::state::TableState;+use crate::geometry::Bounds;+use crate::sink::{current_palette, with_sink};+use crate::Painter;++impl<D: TableDelegate> TableState<D> {+ /// Draw the table into `p` (logical pixels, `b` = the element's box).+ pub(crate) fn draw(&self, b: Bounds<f32>, p: &mut Painter) {+ with_sink(p, b.origin, self.scale(), |sink| {+ with_scratch(|s| paint_table(self, self.delegate(), ¤t_palette(), self.delegate().empty_text(), s, sink));+ });+ }+}++#[cfg(test)]+mod tests {+ use std::alloc::{GlobalAlloc, Layout, System};+ use std::cell::Cell;++ use crate::prelude::*;+ use crate::table::{Cell as TableCell, CellSource, Column, DataTable, TableDelegate, TableState};++ /// Counts the allocations the armed thread makes.+ struct Counting;++ thread_local! {+ static ARMED: Cell<bool> = const { Cell::new(false) };+ static COUNT: Cell<usize> = const { Cell::new(0) };+ }++ // SAFETY: forwards to the system allocator; the counters are const-initialised+ // thread-locals without destructors, so counting never allocates.+ unsafe impl GlobalAlloc for Counting {+ unsafe fn alloc(&self, l: Layout) -> *mut u8 {+ if ARMED.get() {+ COUNT.set(COUNT.get() + 1);+ }+ unsafe { System.alloc(l) }+ }+ unsafe fn dealloc(&self, p: *mut u8, l: Layout) {+ unsafe { System.dealloc(p, l) }+ }+ unsafe fn realloc(&self, p: *mut u8, l: Layout, n: usize) -> *mut u8 {+ if ARMED.get() {+ COUNT.set(COUNT.get() + 1);+ }+ unsafe { System.realloc(p, l, n) }+ }+ }++ #[global_allocator]+ static A: Counting = Counting;++ struct Big;+ impl CellSource for Big {+ fn cell(&self, row: usize, col: usize) -> TableCell<'_> {+ TableCell::U64((row * 31 + col) as u64)+ }+ }+ impl TableDelegate for Big {+ fn columns_count(&self, _: &App) -> usize {+ 20+ }+ fn rows_count(&self, _: &App) -> usize {+ 1_000_000+ }+ fn column(&self, ix: usize, _: &App) -> Column {+ // a narrow column so some cells need the ellipsis path too+ Column::new(format!("c{ix}"), format!("Column {ix}")).sortable().width(px(if ix == 3 { 40.0 } else { 110.0 }))+ }+ }++ struct V(Entity<TableState<Big>>);+ impl Render for V {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ body().m_0().child(div().w(px(900.0)).h(px(500.0)).child(DataTable::new(&self.0).stripe(true)))+ }+ }++ #[test]+ fn steady_state_draw_does_not_allocate() {+ Application::headless().run(|cx| {+ let mut table = None;+ let win = cx+ .open_window(WindowOptions::default(), |w, cx| {+ let t = cx.new(|cx| TableState::new(Big, w, cx).row_header(true));+ table = Some(t);+ cx.new(|_| V(t))+ })+ .unwrap();+ let t = table.unwrap();+ cx.draw(win.id);+ cx.draw(win.id);+ t.update(cx, |s, _| s.scroll_by(1000.0, 5_000_000.0));+ let st = t.read(cx);+ let b = st.bounds;+ assert!(b.size.width > 100.0);+ let mut p = Painter::new();+ for _ in 0..4 {+ p.reset();+ st.draw(b, &mut p); // warm: the display list, scratch strings and width cache grow+ }+ p.reset();+ ARMED.set(true);+ COUNT.set(0);+ st.draw(b, &mut p);+ ARMED.set(false);+ assert_eq!(COUNT.get(), 0, "a steady-state frame allocated");+ });+ }+}diff --git a/bindings/rust/blenderui/src/table/state.rs b/bindings/rust/blenderui/src/table/state.rsnew file mode 100644index 0000000..d1baf64--- /dev/null+++ b/bindings/rust/blenderui/src/table/state.rs@@ -0,0 +1,156 @@+//! [`TableState`]: the entity around a [`TableCore`], like gpui-component's+//! `TableState`. The core (in the `blenderui-table` crate) holds the model+//! (scroll, widths, order, sort, selection ...), the delegate, and the glue+//! shared by every adapter; what is here is what needs blenderui: the+//! [`Host`] that reaches the delegate's hooks and the window, and turning+//! engine input into the core's.+//!+//! The core's API is reachable on the state through `Deref`+//! (`state.rows()`, `state.selected_row()`, `state.set_selected_row(r, cx)`,+//! `state.sort_by(..)` ...).++use std::marker::PhantomData;+use std::ops::{Deref, DerefMut, Range};++use blenderui_table::{table_option_builders, Button, Column, ColumnGroup, ColumnSort, Host, Key, Mods, Point, TableCore};++use super::delegate::TableDelegate;+use crate::{App, Bounds, Context, Entity, KeyDownEvent, Modifiers, MouseButton, Pixels, SharedString, Window};++/// Reaches the delegate trait, the window and the entity context.+pub struct BuiHost<D>(PhantomData<fn() -> D>);++impl<D: TableDelegate> Host for BuiHost<D> {+ type Delegate = D;+ type Window = Window;+ type Cx<'a> = Context<'a, TableState<D>>;++ fn columns(d: &D, cx: &Self::Cx<'_>) -> Vec<Column> {+ let app: &App = cx;+ (0..d.columns_count(app)).map(|i| d.column(i, app)).collect()+ }+ fn group_headers(d: &D, cx: &Self::Cx<'_>) -> Option<Vec<Vec<ColumnGroup>>> {+ d.group_headers(cx)+ }+ fn rows_count(d: &D, cx: &Self::Cx<'_>) -> usize {+ d.rows_count(cx)+ }+ fn loading(d: &D, cx: &Self::Cx<'_>) -> bool {+ d.loading(cx)+ }+ fn sort_by_mask(d: &D) -> bool {+ d.sort_by_mask()+ }+ fn perform_sort(d: &mut D, col: usize, sort: ColumnSort, window: &mut Window, cx: &mut Self::Cx<'_>) {+ d.perform_sort(col, sort, window, cx);+ }+ fn move_column(d: &mut D, col: usize, to: usize, window: &mut Window, cx: &mut Self::Cx<'_>) {+ d.move_column(col, to, window, cx);+ }+ fn fit_column(d: &mut D, col: usize, window: &mut Window, cx: &mut Self::Cx<'_>) -> Option<f32> {+ d.fit_column(col, window, cx).map(|p| p.0)+ }+ fn visible_rows_changed(d: &mut D, rows: Range<usize>, window: &mut Window, cx: &mut Self::Cx<'_>) {+ d.visible_rows_changed(rows, window, cx);+ }+ fn visible_columns_changed(d: &mut D, cols: Range<usize>, window: &mut Window, cx: &mut Self::Cx<'_>) {+ d.visible_columns_changed(cols, window, cx);+ }+ fn has_more(d: &D, cx: &Self::Cx<'_>) -> bool {+ d.has_more(cx)+ }+ fn load_more_threshold(d: &D) -> usize {+ d.load_more_threshold()+ }+ fn load_more(d: &mut D, window: &mut Window, cx: &mut Self::Cx<'_>) {+ d.load_more(window, cx);+ }+ fn write_clipboard(window: &mut Window, _: &mut Self::Cx<'_>, text: &str) {+ window.write_clipboard(text);+ }+ fn notify(cx: &mut Self::Cx<'_>) {+ cx.notify();+ }+ fn refresh(window: &mut Window) {+ window.refresh();+ }+}++/// The table.+pub struct TableState<D: TableDelegate> {+ core: TableCore<BuiHost<D>>,+ /// Where the table was last laid out (window coordinates).+ pub(crate) bounds: Bounds<f32>,+ pub(crate) id: SharedString,+}++impl<D: TableDelegate> Deref for TableState<D> {+ type Target = TableCore<BuiHost<D>>;+ fn deref(&self) -> &Self::Target {+ &self.core+ }+}++impl<D: TableDelegate> DerefMut for TableState<D> {+ fn deref_mut(&mut self) -> &mut Self::Target {+ &mut self.core+ }+}++const fn mods(m: Modifiers) -> Mods {+ Mods { shift: m.shift, control: m.control, alt: m.alt }+}++impl<D: TableDelegate> TableState<D> {+ pub fn new(delegate: D, _: &mut Window, cx: &mut Context<Self>) -> Self {+ let id = SharedString::from(format!("bui-table-{}", cx.entity().entity_id()));+ Self { core: TableCore::new(delegate, cx), bounds: Bounds::default(), id }+ }++ // gpui-component's builders+ table_option_builders!();++ /// Called while rendering with the table's last bounds (see+ /// [`TableCore::sync`]).+ pub fn sync(&mut self, bounds: Bounds<f32>, unit: f32, scale: f32, window: &mut Window, cx: &mut Context<Self>) {+ self.bounds = bounds;+ self.core.sync(bounds.size.width, bounds.size.height, unit, scale, window, cx);+ }++ /// The width of delegate column `col_ix`.+ pub fn col_width(&self, col_ix: usize) -> Option<Pixels> {+ self.core.col_width(col_ix).map(Pixels)+ }++ // -- engine input -> the core's ---------------------------------------------------------------------+ fn local(&self, pos: crate::Point<f32>) -> Point {+ Point { x: pos.x - self.bounds.origin.x, y: pos.y - self.bounds.origin.y }+ }++ /// Pointer pressed at window position `pos`.+ pub fn mouse_down(&mut self, pos: crate::Point<f32>, button: MouseButton, m: Modifiers, clicks: usize,+ window: &mut Window, cx: &mut Context<Self>) {+ let b = match button {+ MouseButton::Left => Button::Left,+ MouseButton::Right => Button::Right,+ MouseButton::Middle => Button::Middle,+ };+ let p = self.local(pos);+ self.core.pointer_down(p, b, mods(m), clicks, window, cx);+ }++ /// Pointer moved to window position `pos`. Returns whether to redraw.+ pub fn mouse_move(&mut self, pos: crate::Point<f32>, window: &mut Window, cx: &mut Context<Self>) -> bool {+ let p = self.local(pos);+ self.core.pointer_move(p, window, cx)+ }++ /// A key while the table has focus.+ pub fn key_down(&mut self, e: &KeyDownEvent, window: &mut Window, cx: &mut Context<Self>) -> bool {+ let k = &e.keystroke;+ self.core.key_down(Key::parse(&k.key), mods(k.modifiers), window, cx)+ }+}++/// A handle type for docs and signatures.+pub type TableHandle<D> = Entity<TableState<D>>;diff --git a/bindings/rust/blenderui/src/vlist/element.rs b/bindings/rust/blenderui/src/vlist/element.rsnew file mode 100644index 0000000..c4e69ff--- /dev/null+++ b/bindings/rust/blenderui/src/vlist/element.rs@@ -0,0 +1,150 @@+//! [`VariableList`]: the element that shows a [`ListState`].+//!+//! One painted leaf (a canvas drawn straight from the state) inside a+//! wrapper that takes pointer, wheel and keyboard input: a frame builds a+//! constant number of elements however many items there are. Layout (which+//! measures and mutates the state) runs while rendering, in the deferred+//! hook; painting only reads.++use std::rc::Rc;++use blenderui_vlist::{ChatStyle, Hit, ItemPainter, ItemSource, List, Measurer, VecSource};++use super::state::ListState;+use crate::css::Decl;+use crate::element::{canvas_with, Div};+use crate::html::div;+use crate::{px, AnyElement, App, Entity, IntoElement, MouseButton, ParentElement, Styled, Window};++type Listener<S, P> = Rc<dyn Fn(usize, &mut List<S, P>)>;++/// A variable-height list over `state`.+///+/// ```ignore+/// let list = cx.new(|cx| ListState::new(List::new(source, style, 600.0, 400.0, Options::default()).unwrap(), cx));+/// // in render:+/// div().size_full().child(variable_list(&list).on_item_click(|i, list| println!("{i}")))+/// ```+pub struct VariableList<S: ItemSource + 'static, P: Measurer + ItemPainter + 'static> {+ state: Entity<ListState<S, P>>,+ base: Div,+ on_item_click: Option<Listener<S, P>>,+}++/// The element for a list state.+pub fn variable_list<S: ItemSource, P: Measurer + ItemPainter>(state: &Entity<ListState<S, P>>) -> VariableList<S, P> {+ VariableList { state: *state, base: div().relative().overflow_hidden().size_full(), on_item_click: None }+}++/// A chat: a [`VariableList`] over a [`ChatList`] where a click selects a+/// whole message (click it again to deselect).+pub fn chat_list(state: &Entity<ListState<VecSource, ChatStyle>>) -> VariableList<VecSource, ChatStyle> {+ variable_list(state).on_item_click(|i, list| list.toggle_selected(i))+}++impl<S: ItemSource, P: Measurer + ItemPainter> VariableList<S, P> {+ /// An item was clicked (item index). The closure may change the list.+ #[must_use]+ pub fn on_item_click(mut self, f: impl Fn(usize, &mut List<S, P>) + 'static) -> Self {+ self.on_item_click = Some(Rc::new(f));+ self+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> Styled for VariableList<S, P> {+ fn decls_mut(&mut self) -> &mut Vec<Decl> {+ self.base.decls_mut()+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> IntoElement for VariableList<S, P> {+ fn into_any_element(self) -> AnyElement {+ let VariableList { state, base, on_item_click } = self;+ let el = base.defer(move |window, cx, el| {+ let id = state.read(cx).id.clone();+ let known = window.bounds_of(&id);+ let bounds = known.unwrap_or_default();+ let scale = window.scale_factor();+ let changed = state.update(cx, |s, _| {+ let moved = known.is_none() || s.bounds != bounds;+ s.sync(bounds, scale, window);+ moved+ });+ if changed {+ window.refresh(); // placed for the first time or resized: lay out once more with the size+ }+ let (down, mv, up, wh, key) = (state, state, state, state, state);+ let click = on_item_click;+ let taken = std::mem::replace(el, Div::new("div"));+ *el = taken+ .id(id)+ .on_any_mouse_down(move |e, w: &mut Window, cx: &mut App| {+ if e.button != MouseButton::Left {+ return;+ }+ let local = |s: &ListState<S, P>| (e.position.x.0 - s.bounds.origin.x, e.position.y.0 - s.bounds.origin.y);+ state_pointer_down(down, click.as_ref(), local, cx);+ w.refresh();+ })+ .on_mouse_move(move |e, w, cx| {+ let moved = mv.update(cx, |s, _| {+ let y = e.position.y.0 - s.bounds.origin.y;+ if e.pressed_button.is_none() {+ s.pointer_up();+ false+ } else {+ s.pointer_move(y)+ }+ });+ if moved {+ w.refresh();+ }+ })+ .on_mouse_up(MouseButton::Left, move |_, _, cx| up.update(cx, |s, _| s.pointer_up()))+ .on_scroll_wheel(move |e, w, cx| {+ wh.update(cx, |s, _| {+ // a notched wheel gives whole lines; a touchpad fractions of one+ let lines = f64::from(e.delta);+ if std::env::var_os("CHAT_TRACE").is_some() { eprintln!("{:?} WHEEL {lines}", std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map(|d| d.as_millis() % 100_000).unwrap_or(0)); } // TEMP-TRACE+ s.view.wheel(-lines * WHEEL_NOTCH_PX, lines.fract() != 0.0);+ });+ w.request_animation_frame();+ })+ .on_key_down(move |e, w, cx| {+ let handled = key.update(cx, |s, _| s.key(&e.keystroke.key, LINE_PX));+ if handled {+ w.request_animation_frame();+ }+ })+ .child(+ // the canvas alone in its layer, as the data table does+ div().absolute().left(px(0.0)).top(px(0.0)).w_full().h_full().child(+ canvas_with(move |b, p, cx| state.read(cx).draw(b, p, scale)).size_full(),+ ),+ );+ });+ AnyElement::Element(el)+ }+}++/// A line of text in px, for keyboard steps.+const LINE_PX: f64 = 19.0;++/// One wheel notch, in px: several messages per notch.+const WHEEL_NOTCH_PX: f64 = 1000.0;++fn state_pointer_down<S: ItemSource, P: Measurer + ItemPainter>(+ state: Entity<ListState<S, P>>,+ click: Option<&Listener<S, P>>,+ local: impl Fn(&ListState<S, P>) -> (f32, f32),+ cx: &mut App,+) {+ state.update(cx, |s, _| {+ let (x, y) = local(s);+ if let Hit::Item(i) = s.pointer_down(x, y) {+ if let Some(f) = click {+ f(i, s);+ }+ }+ });+}diff --git a/bindings/rust/blenderui/src/vlist/mod.rs b/bindings/rust/blenderui/src/vlist/mod.rsnew file mode 100644index 0000000..c4318dc--- /dev/null+++ b/bindings/rust/blenderui/src/vlist/mod.rs@@ -0,0 +1,40 @@+//! A variable-height virtualized list, chat-grade, from 100 items to 10M+:+//! one design, drawn the way Blender's text view draws (from the newest+//! line, only what is visible), with a Fenwick-over-blocks height index.+//!+//! Everything that is not blenderui lives in the `blenderui-vlist` crate,+//! once: the height index, anchor-based scrolling, measuring and wrapping,+//! the item sources (in memory, file-backed) and the chat look. This module+//! is the adapter:+//!+//! * [`ListState`]: the entity around a [`List`] (the core's items + style ++//! view), which lays a frame out while rendering and answers input;+//! * [`VariableList`] ([`variable_list`]): the element, one painted leaf that+//! draws the state ([`crate::sink`] turns the core's paint calls into the+//! engine's display list), plus pointer, wheel and keyboard input;+//! * [`chat_list`]: a [`VariableList`] over a [`ChatList`] with whole-message+//! selection wired.+//!+//! ```ignore+//! let chat = cx.new(|cx| ListState::new(ChatList::from_messages(msgs, palette, 600.0, 400.0, opts), cx));+//! // in render+//! chat_list(&chat).size_full()+//! // from anywhere+//! chat.update(cx, |s, _| s.push(message));+//! ```++mod element;+mod state;++pub use blenderui_vlist::{+ Align, Budget, ChatList, ChatStyle, Hit, ItemPainter, ItemSource, List, ListView, Measurer, Message, Nav, Options, Record, VecSource,+};+pub use blenderui_vlist::synth;+pub use element::{chat_list, variable_list, VariableList};+pub use state::ListState;++/// The colors of the engine's current theme, for a list style's palette.+#[must_use]+pub fn theme_palette() -> blenderui_vlist::Palette {+ crate::sink::current_palette()+}diff --git a/bindings/rust/blenderui/src/vlist/state.rs b/bindings/rust/blenderui/src/vlist/state.rsnew file mode 100644index 0000000..b24071c--- /dev/null+++ b/bindings/rust/blenderui/src/vlist/state.rs@@ -0,0 +1,77 @@+//! [`ListState`]: the entity around a [`List`]. It owns the core list, the+//! element's id and last bounds, and the frame clock; its `Deref` makes the+//! core's API (`state.view`, `state.source`, `state.push(..)` for a chat)+//! read as its own.++use std::ops::{Deref, DerefMut};+use std::time::Instant;++use blenderui_vlist::{Budget, ItemPainter, ItemSource, List, Measurer};++use crate::geometry::Bounds;+use crate::sink::{measure, with_sink};+use crate::{Context, SharedString, Window};++/// The list.+pub struct ListState<S: ItemSource + 'static, P: Measurer + ItemPainter + 'static> {+ list: List<S, P>,+ /// Where the list was last laid out (window coordinates).+ pub(crate) bounds: Bounds<f32>,+ pub(crate) id: SharedString,+ last_frame: Option<Instant>,+}++impl<S: ItemSource, P: Measurer + ItemPainter> Deref for ListState<S, P> {+ type Target = List<S, P>;+ fn deref(&self) -> &Self::Target {+ &self.list+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> DerefMut for ListState<S, P> {+ fn deref_mut(&mut self) -> &mut Self::Target {+ &mut self.list+ }+}++impl<S: ItemSource, P: Measurer + ItemPainter> ListState<S, P> {+ /// An entity state for `list` (call inside `cx.new`).+ pub fn new(list: List<S, P>, cx: &mut Context<Self>) -> Self {+ let id = SharedString::from(format!("bui-vlist-{}", cx.entity().entity_id()));+ Self { list, bounds: Bounds::default(), id, last_frame: None }+ }++ /// Called while rendering with the list's last bounds: resize, advance+ /// the smooth scroll, lay the frame out and do idle measuring. Returns+ /// whether another frame is wanted (easing, or measuring left to do).+ pub(crate) fn sync(&mut self, bounds: Bounds<f32>, scale: f32, window: &mut Window) -> bool {+ self.bounds = bounds;+ let (w, h) = (bounds.size.width, bounds.size.height);+ if w < 1.0 || h < 1.0 {+ return false;+ }+ if (self.list.view.viewport().0 - w).abs() > f32::EPSILON || (self.list.view.viewport().1 - h).abs() > f32::EPSILON {+ self.list.resize(w, h);+ }+ let now = Instant::now();+ let dt = self.last_frame.replace(now).map_or(1.0 / 60.0, |t| now.duration_since(t).as_secs_f64().min(0.1));+ let mut more = self.list.view.tick(dt);+ let mut tw = |s: &str, z: f32| measure(s, z, scale);+ self.list.layout(&mut tw);+ if !self.list.view.flinging() {+ more |= self.list.prefetch(&mut tw, Budget::Time(std::time::Duration::from_micros(800)));+ }+ if more {+ window.request_animation_frame();+ } else {+ // idle: the next frame starts a fresh clock+ self.last_frame = None;+ }+ more+ }++ /// Draw the laid-out frame into `p` (logical px, `b` = the element's box).+ pub(crate) fn draw(&self, b: Bounds<f32>, p: &mut crate::Painter, scale: f32) {+ with_sink(p, b.origin, scale, |sink| self.list.paint(sink));+ }+}diff --git a/bindings/rust/blenderui/src/window.rs b/bindings/rust/blenderui/src/window.rsindex 0fe7db0..00c1ac1 100644--- a/bindings/rust/blenderui/src/window.rs+++ b/bindings/rust/blenderui/src/window.rs@@ -681,6 +681,45 @@ impl App {});}+ /// Click at (x, y) with modifier keys held (`ctrl`, `shift`).+ pub fn simulate_click_with(&mut self, window: WindowId, x: f32, y: f32, ctrl: bool, shift: bool) {+ let mods = c_int::from(shift) | (c_int::from(ctrl) << 1);+ self.simulate_mouse_move(window, x, y);+ self.input(window, |ctx, s| unsafe {+ sys::BK_press(ctx, (x * s) as c_int, (y * s) as c_int, mods);+ });+ self.input(window, |ctx, s| unsafe {+ sys::BK_release(ctx, (x * s) as c_int, (y * s) as c_int, sys::BK_BUTTON1 | mods);+ });+ }++ /// Press at `from`, drag to `to` and release there.+ pub fn simulate_drag(&mut self, window: WindowId, from: (f32, f32), to: (f32, f32)) {+ self.simulate_mouse_move(window, from.0, from.1);+ self.input(window, |ctx, s| unsafe {+ sys::BK_press(ctx, (from.0 * s) as c_int, (from.1 * s) as c_int, 0);+ });+ for k in 1..=4 {+ let t = k as f32 / 4.0;+ let (x, y) = (from.0 + (to.0 - from.0) * t, from.1 + (to.1 - from.1) * t);+ self.input(window, |ctx, s| unsafe {+ sys::BK_motion(ctx, (x * s) as c_int, (y * s) as c_int, sys::BK_BUTTON1);+ });+ }+ self.input(window, |ctx, s| unsafe {+ sys::BK_release(ctx, (to.0 * s) as c_int, (to.1 * s) as c_int, sys::BK_BUTTON1);+ });+ }++ /// A key with modifier keys held.+ pub fn simulate_key_with(&mut self, window: WindowId, text: &str, keysym: &str, ctrl: bool, shift: bool) {+ let mods = c_int::from(shift) | (c_int::from(ctrl) << 1);+ let (t, k) = (CString::new(text).unwrap_or_default(), CString::new(keysym).unwrap_or_default());+ self.input(window, |ctx, _| unsafe {+ sys::BK_key(ctx, t.as_ptr(), k.as_ptr(), mods);+ });+ }+/// Scroll the wheel at (x, y): positive `lines` scroll the content up.pub fn simulate_scroll(&mut self, window: WindowId, x: f32, y: f32, lines: i32) {self.simulate_mouse_move(window, x, y);@@ -1017,6 +1056,28 @@ impl Window {self.dirty = true;}+ /// Bounds (logical pixels) of the element with `.id(id)` as of the last+ /// frame. Works while rendering (views read where they were last+ /// placed); inside an event listener the frame is lent out, so a view+ /// keeps what it read while rendering.+ pub fn bounds_of(&self, id: &str) -> Option<Bounds<f32>> {+ let f = self.frame.as_ref()?;+ f.by_key().get(&id_key(id)).map(|&i| f.nodes[i].bounds)+ }++ /// Put `text` on the clipboard.+ pub fn write_clipboard(&mut self, text: &str) {+ let c = CString::new(text.replace('\0', "")).unwrap_or_default();+ // SAFETY: a live context and a NUL-terminated string the kit copies.+ unsafe { sys::BK_clipboard_set(self.ctx, c.as_ptr()) };+ }++ /// One UI unit (Blender's `UI_UNIT_Y`, a row of widgets) in logical pixels.+ pub fn ui_unit(&self) -> f32 {+ // SAFETY: a constant query.+ unsafe { sys::BK_unit() as f32 / self.scale }+ }+fn viewport(&self) -> (f32, f32) {(self.phys.0 as f32 / self.scale, self.phys.1 as f32 / self.scale)}@@ -1030,7 +1091,9 @@ impl Window {let root = {let _s = span(Phase::Render);crate::hooks::begin(self.id);- view(self, app)+ let mut root = view(self, app);+ crate::element::resolve_deferred(&mut root, self, app);+ root};if self.view.is_none() {self.view = Some(view);@@ -1051,7 +1114,7 @@ impl Window {p.reset();{let _s = span(Phase::Paint);- paint_frame(&frame, &self.caches.styles, &mut self.caches.text, p, vp, self.scale);+ paint_frame(&frame, &self.caches.styles, &mut self.caches.text, p, vp, self.scale, app);}{let _s = span(Phase::Flush);diff --git a/bindings/rust/blenderui/tests/table.rs b/bindings/rust/blenderui/tests/table.rsnew file mode 100644index 0000000..21f27be--- /dev/null+++ b/bindings/rust/blenderui/tests/table.rs@@ -0,0 +1,272 @@+//! The data table and `uniform_list`, end to end in off-screen windows.++use std::ffi::CStr;++use blenderui::prelude::*;+use blenderui::table::{Cell, CellSource, Column, ColumnSort, DataTable, TableDelegate, TableState};++const HEADER: f32 = 22.0; // 1.1 * UI_UNIT_Y+const ROW: f32 = 20.0; // UI_UNIT_Y++/// rows x 20 columns of derived numbers; column 0 is the row, pinned.+struct Grid {+ rows: usize,+}++fn val(r: usize, c: usize) -> u64 {+ if c == 0 { r as u64 } else { (r as u64 * 2_654_435_761 + c as u64 * 40_503) % 100_003 }+}++impl CellSource for Grid {+ fn cell(&self, row: usize, col: usize) -> Cell<'_> {+ Cell::U64(val(row, col))+ }+}++impl TableDelegate for Grid {+ fn columns_count(&self, _: &App) -> usize {+ 20+ }+ fn rows_count(&self, _: &App) -> usize {+ self.rows+ }+ fn column(&self, ix: usize, _: &App) -> Column {+ if ix == 0 {+ Column::new("id", "ID").sortable().width(px(80.0)).fixed_left()+ } else {+ Column::new(format!("c{ix}"), format!("Col {ix}")).sortable().width(px(100.0))+ }+ }+}++struct View {+ table: Entity<TableState<Grid>>,+}++impl Render for View {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ body().m_0().child(div().w(px(800.0)).h(px(400.0)).child(DataTable::new(&self.table).stripe(true)))+ }+}++fn open(cx: &mut App, rows: usize, row_header: bool) -> (WindowId, Entity<TableState<Grid>>) {+ let opts = WindowOptions {+ window_bounds: Some(WindowBounds::Windowed(Bounds {+ origin: point(px(0.0), px(0.0)),+ size: size(px(800.0), px(400.0)),+ })),+ ..Default::default()+ };+ let mut handle = None;+ let win = cx+ .open_window(opts, |window, cx| {+ let table = cx.new(|cx| TableState::new(Grid { rows }, window, cx).row_header(row_header));+ handle = Some(table);+ cx.new(|_| View { table })+ })+ .unwrap();+ (win.id, handle.unwrap())+}++fn frame(cx: &mut App, id: WindowId) -> (usize, usize, Vec<u32>) {+ cx.draw(id); // the first frame learns the table's size, the second draws with it+ cx.draw(id)+}++fn band(img: &(usize, usize, Vec<u32>), x0: usize, x1: usize, y0: usize, y1: usize) -> Vec<u32> {+ (y0..y1).flat_map(|y| img.2[y * img.0 + x0..y * img.0 + x1].to_vec()).collect()+}++fn px_at(img: &(usize, usize, Vec<u32>), x: usize, y: usize) -> u32 {+ img.2[y * img.0 + x]+}++fn run(theme: &str, f: impl FnOnce(&mut App)) {+ Application::headless().theme(theme).run(f);+}++#[test]+fn only_visible_rows_are_touched_and_scrolling_moves_the_range() {+ run("dark", |cx| {+ let (id, t) = open(cx, 1_000_000, false);+ frame(cx, id);+ let first = t.read(cx).visible_range().clone();+ assert_eq!(first.rows().start, 0);+ assert!(first.rows().len() <= 20, "{:?}", first.rows());+ assert!(first.cols().len() < 20);+ cx.simulate_scroll(id, 400.0, 200.0, -10);+ frame(cx, id);+ let moved = t.read(cx).visible_range().clone();+ assert!(moved.rows().start >= 25, "{:?}", moved.rows());+ assert!(moved.rows().len() <= 20);+ // the scroll extent is the full table+ t.update(cx, |s, _| s.scroll_by(0.0, 1e12));+ cx.notify_all();+ frame(cx, id);+ assert_eq!(t.read(cx).visible_range().rows().end, 1_000_000);+ });+}++#[test]+fn stripes_header_stickiness_and_pinned_columns() {+ run("dark", |cx| {+ let (id, t) = open(cx, 100_000, false);+ let a = frame(cx, id);+ // header differs from the body; row 1 is striped, row 0 is not+ let hdr = px_at(&a, 775, 4);+ let r0 = px_at(&a, 770, (HEADER + ROW * 0.5) as usize);+ let r1 = px_at(&a, 770, (HEADER + ROW * 1.5) as usize);+ let r2 = px_at(&a, 770, (HEADER + ROW * 2.5) as usize);+ assert_ne!(hdr, r0);+ assert_ne!(r0, r1);+ assert_eq!(r0, r2);+ // scrolling down keeps the header band pixel for pixel+ t.update(cx, |s, _| s.scroll_by(0.0, 4321.0));+ cx.notify_all();+ let b = frame(cx, id);+ assert_eq!(band(&a, 0, 800, 0, HEADER as usize - 1), band(&b, 0, 800, 0, HEADER as usize - 1));+ assert_ne!(band(&a, 0, 800, 30, 380), band(&b, 0, 800, 30, 380));+ // scrolling right keeps the pinned column (x < 80) and moves the rest+ t.update(cx, |s, _| s.scroll_by(0.0, -1e9));+ cx.notify_all();+ let c = frame(cx, id);+ t.update(cx, |s, _| s.scroll_by(250.0, 0.0));+ cx.notify_all();+ let d = frame(cx, id);+ assert_eq!(band(&c, 0, 79, 0, 400), band(&d, 0, 79, 0, 400));+ assert_ne!(band(&c, 100, 800, 0, 400), band(&d, 100, 800, 0, 400));+ });+}++#[test]+fn light_and_dark_themes_differ() {+ let mut shots = Vec::new();+ for theme in ["dark", "light"] {+ run(theme, |cx| {+ let (id, _) = open(cx, 1000, true);+ shots.push(px_at(&frame(cx, id), 790, 300));+ });+ }+ assert_ne!(shots[0], shots[1]);+ // dark is darker+ let lum = |p: u32| (p >> 16 & 255) + (p >> 8 & 255) + (p & 255);+ assert!(lum(shots[0]) < lum(shots[1]));+}++#[test]+fn dragging_a_header_border_resizes_the_column() {+ run("dark", |cx| {+ let (id, t) = open(cx, 1000, false);+ frame(cx, id);+ assert_eq!(t.read(cx).col_width(0).map(|p| p.0), Some(80.0));+ cx.simulate_drag(id, (80.0, 10.0), (130.0, 10.0));+ let w = t.read(cx).col_width(0).unwrap().0;+ assert!((w - 130.0).abs() <= 1.0, "{w}");+ // clamped to the column's limits+ cx.simulate_drag(id, (130.0, 10.0), (2.0, 10.0));+ assert_eq!(t.read(cx).col_width(0).unwrap().0, 20.0);+ });+}++#[test]+fn header_click_sorts_by_index_mask_and_cycles() {+ run("dark", |cx| {+ let n = 5000;+ let (id, t) = open(cx, n, false);+ frame(cx, id);+ let min = (0..n).map(|r| val(r, 1)).min().unwrap();+ let max = (0..n).map(|r| val(r, 1)).max().unwrap();+ cx.simulate_click(id, 130.0, 10.0);+ assert_eq!(t.read(cx).sorted_by(), Some((1, ColumnSort::Ascending)));+ assert_eq!(val(t.read(cx).row_at(0), 1), min);+ cx.simulate_click(id, 130.0, 10.0);+ assert_eq!(t.read(cx).sorted_by(), Some((1, ColumnSort::Descending)));+ assert_eq!(val(t.read(cx).row_at(0), 1), max);+ cx.simulate_click(id, 130.0, 10.0);+ assert_eq!(t.read(cx).sorted_by(), None);+ assert_eq!(t.read(cx).row_at(7), 7);+ });+}++#[test]+fn selection_keyboard_and_tsv_copy() {+ run("dark", |cx| {+ let (id, t) = open(cx, 5, false);+ frame(cx, id);+ let row_y = |r: usize| HEADER + ROW * r as f32 + ROW / 2.0;+ cx.simulate_click(id, 300.0, row_y(2));+ assert_eq!(t.read(cx).selected_row(), Some(2));+ cx.simulate_key(id, "", "Down");+ assert_eq!(t.read(cx).selected_row(), Some(3));+ cx.simulate_key(id, "", "Up");+ cx.simulate_key(id, "", "Up");+ assert_eq!(t.read(cx).selected_row(), Some(1));+ cx.simulate_click_with(id, 300.0, row_y(3), false, true); // shift: range+ assert_eq!(t.read(cx).selected_rows().collect::<Vec<_>>(), vec![1, 2, 3]);+ cx.simulate_click_with(id, 300.0, row_y(0), true, false); // ctrl: toggle+ assert_eq!(t.read(cx).selected_rows().count(), 4);+ cx.simulate_key(id, "", "End");+ assert_eq!(t.read(cx).selected_row(), Some(4));+ cx.simulate_key_with(id, "a", "a", true, false);+ assert_eq!(t.read(cx).selected_rows().count(), 5);+ cx.simulate_key_with(id, "c", "c", true, false);+ let text = t.read(cx).selection_text();+ let lines: Vec<&str> = text.lines().collect();+ assert_eq!(lines.len(), 5);+ let cells: Vec<&str> = lines[3].split('\t').collect();+ assert_eq!(cells.len(), 20);+ assert_eq!(cells[0], "3");+ assert_eq!(cells[1], val(3, 1).to_string());+ // and it reached the clipboard+ // SAFETY: the kit returns a NUL-terminated malloc'd string (leaked: a test).+ let clip = unsafe {+ let p = blenderui::sys::BK_clipboard_get(std::ptr::null_mut());+ CStr::from_ptr(p).to_string_lossy().into_owned()+ };+ assert_eq!(clip, text);+ cx.simulate_key(id, "", "Escape");+ assert_eq!(t.read(cx).selected_rows().count(), 0);+ });+}++struct Items;++impl Render for Items {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ body().m_0().child(+ uniform_list("items", 1_000_000, |range, _, _| {+ range.map(|i| div().id(format!("item-{i}")).child(format!("Item {i}"))).collect::<Vec<_>>()+ })+ .item_height(px(20.0))+ .h(px(200.0))+ .w(px(300.0)),+ )+ }+}++#[test]+fn uniform_list_builds_only_the_visible_items() {+ run("dark", |cx| {+ let opts = WindowOptions {+ window_bounds: Some(WindowBounds::Windowed(Bounds {+ origin: point(px(0.0), px(0.0)),+ size: size(px(400.0), px(300.0)),+ })),+ ..Default::default()+ };+ let id = cx.open_window(opts, |_, cx| cx.new(|_| Items)).unwrap().id;+ cx.draw(id);+ cx.draw(id);+ assert!(cx.element_bounds(id, "item-0").is_some());+ assert!(cx.element_bounds(id, "item-9").is_some());+ assert!(cx.element_bounds(id, "item-40").is_none());+ // 100 wheel lines = 4000 px+ cx.simulate_scroll(id, 100.0, 100.0, -100);+ cx.draw(id);+ assert!(cx.element_bounds(id, "item-0").is_none());+ let off = cx.window(id).unwrap().scroll_offset("items").1;+ assert!(off > 3000.0, "{off}");+ assert!(cx.element_bounds(id, &format!("item-{}", (off / 20.0) as usize + 3)).is_some());+ });+}+diff --git a/bindings/rust/blenderui/tests/vlist.rs b/bindings/rust/blenderui/tests/vlist.rsnew file mode 100644index 0000000..206ab09--- /dev/null+++ b/bindings/rust/blenderui/tests/vlist.rs@@ -0,0 +1,150 @@+//! The variable list and the chat, end to end in off-screen windows.++use blenderui::prelude::*;+use blenderui::vlist::{chat_list, synth, theme_palette, ChatList, ChatStyle, ItemSource, ListState, Options, VecSource};++type Chat = Entity<ListState<VecSource, ChatStyle>>;++struct View {+ chat: Chat,+}++impl Render for View {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ body().m_0().child(div().w(px(700.0)).h(px(400.0)).child(chat_list(&self.chat)))+ }+}++fn open(cx: &mut App, n: u64) -> (WindowId, Chat) {+ let opts = WindowOptions {+ window_bounds: Some(WindowBounds::Windowed(Bounds { origin: point(px(0.0), px(0.0)), size: size(px(700.0), px(400.0)) })),+ ..Default::default()+ };+ let mut handle = None;+ let win = cx+ .open_window(opts, |_, cx| {+ let o = Options { start_at_end: true, ..Options::default() };+ let chat = cx.new(|cx| ListState::new(ChatList::from_messages(synth::messages(0, n), theme_palette(), 700.0, 400.0, o), cx));+ handle = Some(chat);+ cx.new(|_| View { chat })+ })+ .unwrap();+ (win.id, handle.unwrap())+}++fn frame(cx: &mut App, id: WindowId) -> (usize, usize, Vec<u32>) {+ cx.draw(id); // the first frame learns the size, the second lays out with it+ cx.draw(id);+ cx.draw(id)+}++fn run(theme: &str, f: impl FnOnce(&mut App)) {+ Application::headless().theme(theme).run(f);+}++fn distinct(img: &(usize, usize, Vec<u32>)) -> usize {+ let mut v = img.2.clone();+ v.sort_unstable();+ v.dedup();+ v.len()+}++#[test]+fn opens_at_the_newest_message_and_draws_text() {+ run("dark", |cx| {+ let (id, chat) = open(cx, 100_000);+ let img = frame(cx, id);+ let s = chat.read(cx);+ assert_eq!(s.view.placed().last().unwrap().item, 99_999);+ assert!(s.view.at_bottom());+ assert!(s.view.index().measured_items() < 3000, "only the tail was measured");+ // text, avatars and a scrollbar: far more than a flat fill+ assert!(distinct(&img) > 12, "{}", distinct(&img));+ });+}++#[test]+fn scrolling_up_moves_the_content_and_stops_following() {+ run("dark", |cx| {+ let (id, chat) = open(cx, 50_000);+ let a = frame(cx, id);+ cx.simulate_scroll(id, 300.0, 200.0, 10);+ let mut b = frame(cx, id);+ for _ in 0..60 {+ b = cx.draw(id);+ }+ assert_ne!(a.2, b.2, "the wheel scrolled");+ assert!(!chat.read(cx).view.at_bottom());+ // a new message does not drag the reader down+ let id_before = {+ let s = chat.read(cx);+ s.view.anchor_id(&s.source)+ };+ chat.update(cx, |s, _| s.push(synth::message(50_000)));+ cx.notify_all();+ frame(cx, id);+ let s = chat.read(cx);+ assert_eq!(s.view.anchor_id(&s.source), id_before);+ assert_eq!(s.source.len(), 50_001);+ });+}++#[test]+fn a_new_message_follows_at_the_bottom() {+ run("dark", |cx| {+ let (id, chat) = open(cx, 10_000);+ frame(cx, id);+ chat.update(cx, |s, _| s.push(synth::message(10_000)));+ cx.notify_all();+ frame(cx, id);+ assert_eq!(chat.read(cx).view.placed().last().unwrap().item, 10_000);+ });+}++#[test]+fn clicking_selects_a_whole_message() {+ run("dark", |cx| {+ let (id, chat) = open(cx, 10_000);+ let a = frame(cx, id);+ cx.simulate_click(id, 300.0, 380.0);+ let b = frame(cx, id);+ assert!(chat.read(cx).style.selected.is_some());+ assert_ne!(a.2, b.2, "the selection is painted");+ cx.simulate_click(id, 300.0, 380.0);+ frame(cx, id);+ assert!(chat.read(cx).style.selected.is_none());+ });+}++#[test]+fn the_background_follows_the_theme() {+ let shot = |theme: &str| {+ let mut px = 0;+ run(theme, |cx| {+ let (id, chat) = open(cx, 10_000);+ px = frame(cx, id).2[0];+ assert!(chat.read(cx).view.at_bottom());+ });+ px+ };+ assert_ne!(shot("light"), shot("dark"));+}++#[test]+fn probe_wheel_latency() {+ run("dark", |cx| {+ let (id, chat) = open(cx, 1_000_000);+ frame(cx, id);+ let first = |cx: &App| chat.read(cx).view.placed().first().map(|p| p.item).unwrap();+ println!("start first={}", first(cx));+ for notch in 0..4 {+ cx.simulate_scroll(id, 300.0, 200.0, 3);+ for f in 0..30 {+ std::thread::sleep(std::time::Duration::from_millis(16));+ let t = std::time::Instant::now();+ cx.draw(id);+ println!("notch {notch} frame {f}: first={} draw {:.2} ms", first(cx), t.elapsed().as_secs_f64() * 1000.0);+ }+ }+ });+}diff --git a/docs/rust.md b/docs/rust.mdindex 289d93a..67c5bd9 100644--- a/docs/rust.md+++ b/docs/rust.md@@ -454,6 +454,47 @@ canvas(|b, p| {`with_clip`. Images: `img().src("file.png")` (PNG, decoded once and cached) or`img().image_rgba(w, h, pixels)`.+## Data tables and long lists++`DataTable` is a virtualized table with the API of gpui-component's, drawn the way Blender draws its spreadsheet editor (`space_spreadsheet`): fixed row height, `first_row = scroll_y / row_height`, only the visible rows and the columns that intersect the region, drawn straight into the painter. A frame costs O(visible cells) at any row count, allocates nothing in its own drawing, and sorting or filtering produces a row index list (Blender's `IndexMask`) without copying data.++```rust+use blenderui::table::{Column, DataTable, TableDelegate, TableState};++impl CellSource for People {+ fn cell(&self, row: usize, col: usize) -> Cell<'_> { Cell::U64(row as u64) } // called for visible cells only+}+impl TableDelegate for People {+ fn columns_count(&self, _: &App) -> usize { 2 }+ fn rows_count(&self, _: &App) -> usize { 1_000_000 }+ fn column(&self, ix: usize, _: &App) -> Column { Column::new("id", "ID").sortable().fixed_left() }+}+let table = cx.new(|cx| TableState::new(People, window, cx));+// in render: DataTable::new(&table).stripe(true).on_select(|row, _, _| ...)+```++Features: sticky header and pinned columns, resize and move by dragging headers, click to sort, row (multi, Shift/Ctrl, Ctrl+A), cell and column selection, keyboard navigation, Ctrl+C as TSV, stripes, a row-number column, loading and empty states, `load_more`, Blender dark and light themes. The logic lives once, in the dependency-free `blenderui-table` crate (visible-range math and column culling, index masks and typed parallel sorts, lazy typed cells formatted without allocation, selection, keyboard navigation, column layout, a text-run cache, and the painting through a `PaintSink` trait). blenderui's `table` module is one adapter around it (`Host`, `PaintSink`, element); `bindings/rust/blenderui-table-gpui` is the same for real gpui, with gpui-component's names and a `render_td` escape hatch, outside the main workspace (it builds gpui). On real gpui, 1,000,000 x 20, it takes 1.45 ms per scrolled frame against gpui-component 0.9.0's 4.75 ms (see the website page "Data tables" for the method). `uniform_list(id, count, |range, window, cx| ...)` (gpui's signature) builds only the visible items of a list of real elements, from the same range math. Measured on 1,000,000 x 20: 0.1 ms to build, 1.1 ms per scrolled frame, about 22 ms for a header-click sort; see `examples/bench_table.rs` and the website page "Data tables". Not built yet in blenderui: element cells (`render_td`, available on gpui), a popup context menu, multi-cell ranges, JavaScript and Python wrappers.++## Variable-height lists and chat++`blenderui::vlist` is a virtualized list whose items have different heights (wrapped text, images), built for chat and optimal from 100 items to 10M and beyond with one design. The logic lives once, in the dependency-free `blenderui-vlist` crate (on `blenderui-paint`, which also holds the `PaintSink` trait, the theme `Palette` and the bounded `TextCache` that `blenderui-table` uses):++- **`HeightIndex`**: blocks of up to 1024 items under a Fenwick tree with spare slots on both sides. A block is `Uniform` (a count and a height), `Estimated` (a count and the text bytes it holds; nothing per item) or `Measured` (`u32` prefix sums, 1/64 px, plus an exactness bit per item). A list of one block skips the tree. Offset to item and item to offset are O(log blocks) plus a binary search in a block; a height change is O(log blocks); adding or prepending a page adds blocks without shifting. Heights are fixed-point integers, so ten million rows of 60 px stay exact. Memory follows what was scrolled through.+- **Anchor-based scrolling** (`ListView`): the position is (item, offset inside it), or the end of the list (`stick_to_bottom`, open at the newest item). Heights changing above the viewport, prepended history and edits can't move what is on screen; resize keeps the reader's place; `jump_to` re-aims until the target is measured; the scrollbar thumb comes from the estimate (`Estimator`, calibrated by every measurement).+- **Measuring** (`Measurer`, `TextLayout`): Blender's `textview_wrap_offsets` in pixels, with an ASCII advance table, cached per (text, width, size), a per-frame time budget while flinging (unmeasured items draw as skeletons), idle `prefetch` in the scroll direction, and image heights carried in the record.+- **Sources** (`ItemSource`): `VecSource` and `log::LogSource`, a file-backed append-only log (16-byte records plus a text arena, positioned reads), so 10M messages need a few MB of RAM; `ensure_loaded` and `cancel` for asynchronous loading.++```rust+use blenderui::vlist::{chat_list, synth, theme_palette, ChatList, ListState, Options};++let opts = Options { start_at_end: true, ..Options::default() };+let chat = cx.new(|cx| ListState::new(ChatList::from_messages(synth::messages(0, 1_000_000), theme_palette(), 760.0, 436.0, opts), cx));+// in render: chat_list(&chat) // click selects a whole message+// elsewhere: chat.update(cx, |s, _| s.push(message)); // follows while at the bottom+```++For items that are not messages, build a `List` from your own `ItemSource`, `Measurer` and `ItemPainter` and show it with `variable_list(&state)`. `bindings/rust/blenderui-vlist-gpui` is the same list for real gpui (outside the main workspace); its benchmark against gpui's `list` and gpui-component's `virtual_list` is in `bench/`. Measured numbers and the method are on the website page "Variable-height lists". Not built yet: selecting text across messages, a background measuring thread, damage regions, JavaScript and Python wrappers.+## Headless rendering and tests`Application::headless()` runs the same code without a native window (and isdiff --git a/tools/gen_doc_images.py b/tools/gen_doc_images.pyindex d9b87af..d58b68a 100644--- a/tools/gen_doc_images.py+++ b/tools/gen_doc_images.py@@ -130,7 +130,7 @@ def site_python(theme):site_shots_py.main(SITE_OUT, theme)-def site_rust(theme):+def site_rust(theme, only_example=None):rust = os.path.join(ROOT, "bindings", "rust")if not shutil.which("cargo"):print("rust: cargo not found, skipped")@@ -144,8 +144,12 @@ def site_rust(theme):("site_effects", "feature-html-effects"),("site_grid", "feature-css-grid"),("site_animation", "feature-animation"),+ ("site_data_table", "data-table"),+ ("site_chat", "chat-list"),]for ex, name in shots:+ if only_example and ex != only_example:+ continueout = os.path.join(SITE_OUT, "%s-%s.png" % (name, theme))run(["cargo", "run", "--release", "-j", "1", "-q", "-p", "blenderui", "--example", ex,"--", "--screenshot", out], env=child_env(theme), cwd=rust)@@ -184,7 +188,7 @@ def site_native(theme, which):run([path, "--screenshot", out] + args, env=child_env(theme))-def site(only, themes):+def site(only, themes, example=None):os.makedirs(SITE_OUT, exist_ok=True)before = set(os.listdir(SITE_OUT))for theme in themes:@@ -194,7 +198,7 @@ def site(only, themes):run([sys.executable, os.path.abspath(__file__), "--site-python", theme],env=child_env(theme))if only in (None, "rust"):- site_rust(theme)+ site_rust(theme, example)if only in (None, "js"):site_js(theme)if only in (None, "imgui"):@@ -219,12 +223,13 @@ def main():ap.add_argument("--site", action="store_true")ap.add_argument("--only", choices=("python", "rust", "js", "imgui", "c"))ap.add_argument("--theme", choices=THEMES)+ ap.add_argument("--example", help="with --only rust: just this example (e.g. site_data_table)")ap.add_argument("--site-python", choices=THEMES, help=argparse.SUPPRESS)a = ap.parse_args()if a.site_python:site_python(a.site_python)elif a.site:- site(a.only, [a.theme] if a.theme else list(THEMES))+ site(a.only, [a.theme] if a.theme else list(THEMES), a.example)else:docs_images()diff --git a/website/public/images/shots/chat-list-dark.png b/website/public/images/shots/chat-list-dark.pngnew file mode 100644index 0000000..5883fabBinary files /dev/null and b/website/public/images/shots/chat-list-dark.png differdiff --git a/website/public/images/shots/chat-list-light.png b/website/public/images/shots/chat-list-light.pngnew file mode 100644index 0000000..9114a43Binary files /dev/null and b/website/public/images/shots/chat-list-light.png differdiff --git a/website/public/images/shots/data-table-dark.png b/website/public/images/shots/data-table-dark.pngnew file mode 100644index 0000000..ede2910Binary files /dev/null and b/website/public/images/shots/data-table-dark.png differdiff --git a/website/public/images/shots/data-table-light.png b/website/public/images/shots/data-table-light.pngnew file mode 100644index 0000000..464d194Binary files /dev/null and b/website/public/images/shots/data-table-light.png differdiff --git a/website/src/content/docs/rust/data-table.mdx b/website/src/content/docs/rust/data-table.mdxnew file mode 100644index 0000000..4840740--- /dev/null+++ b/website/src/content/docs/rust/data-table.mdx@@ -0,0 +1,222 @@+---+title: Data tables+description: A virtualized DataTable with the API of gpui-component's, drawn the way Blender draws its spreadsheet editor, plus a uniform_list for long lists. A million rows scroll in about a millisecond.+section: Rust+order: 65+languages: ["rust"]+sources: ["docs/rust.md", "bindings/rust/blenderui-table/src/lib.rs", "bindings/rust/blenderui-table/src/sort.rs", "bindings/rust/blenderui-table/src/paint.rs", "bindings/rust/blenderui-table/src/state.rs", "bindings/rust/blenderui/src/table/mod.rs", "bindings/rust/blenderui/src/table/sink.rs", "bindings/rust/blenderui/src/list.rs", "bindings/rust/blenderui/tests/table.rs", "bindings/rust/blenderui/examples/site_data_table.rs", "bindings/rust/blenderui/examples/bench_table.rs", "bindings/rust/blenderui-table-gpui/src/lib.rs", "bindings/rust/blenderui-table-gpui/examples/bench_gpui.rs"]+---++A table of a million rows is easy to ask for and hard to build: make one element per cell and the window stops responding. **`DataTable` draws only the cells you can see**, straight to the screen, the way Blender's spreadsheet editor does. Scrolling it costs about a millisecond, whether it holds a hundred rows or a million.++<Figure+ shot="data-table"+ alt="A data table of 3D objects with an ID column pinned at the left, a row-number column, Object, Material, Vertices, Faces, Size and Status columns, sorted by Vertices (descending), with three rows selected and a status line below saying 1000000 rows, showing 0..21, 3 selected"+ caption="One million rows: sorted by Vertices, three rows selected, the ID column pinned (<code>examples/site_data_table.rs</code>)."+/>++## A table in 30 lines++You describe your data with a **delegate** (what the columns are, and the text of any cell), keep the table's state in an entity, and put a `DataTable` in your view:++<Tabs sync="rust-syntax" label="Rust syntax">+<Tab label="rsx!">++```rust+use blenderui::prelude::*;+use blenderui::table::{Cell, CellSource, Column, DataTable, TableDelegate, TableState};++struct People;++// The cells: called for the cells in view only. Numbers are typed; the table+// formats them without allocating.+impl CellSource for People {+ fn cell(&self, row: usize, col: usize) -> Cell<'_> {+ Cell::U64(if col == 0 { row as u64 } else { row as u64 * 7 % 1000 })+ }+}++impl TableDelegate for People {+ fn columns_count(&self, _: &App) -> usize { 2 }+ fn rows_count(&self, _: &App) -> usize { 1_000_000 }+ fn column(&self, ix: usize, _: &App) -> Column {+ if ix == 0 { Column::new("id", "ID").sortable().width(px(80.0)).fixed_left() }+ else { Column::new("score", "Score").sortable() }+ }+}++struct App1 { table: Entity<TableState<People>> }++impl Render for App1 {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ rsx! {+ <div class="w-full h-full">+ {DataTable::new(&self.table).stripe(true)}+ </div>+ }+ }+}+```++</Tab>+<Tab label="gpui builders">++```rust+use blenderui::prelude::*;+use blenderui::table::{Cell, CellSource, Column, DataTable, TableDelegate, TableState};++struct People;++impl CellSource for People {+ fn cell(&self, row: usize, col: usize) -> Cell<'_> {+ Cell::U64(if col == 0 { row as u64 } else { row as u64 * 7 % 1000 })+ }+}++impl TableDelegate for People {+ fn columns_count(&self, _: &App) -> usize { 2 }+ fn rows_count(&self, _: &App) -> usize { 1_000_000 }+ fn column(&self, ix: usize, _: &App) -> Column {+ if ix == 0 { Column::new("id", "ID").sortable().width(px(80.0)).fixed_left() }+ else { Column::new("score", "Score").sortable() }+ }+}++struct App1 { table: Entity<TableState<People>> }++impl Render for App1 {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ div().size_full().child(DataTable::new(&self.table).stripe(true))+ }+}++// when opening the window:+// cx.new(|cx| App1 { table: cx.new(|cx| TableState::new(People, window, cx)) })+```++</Tab>+</Tabs>++`Column` sets the width, whether it sorts, resizes, moves or is pinned, and how its text is aligned. A click on a sortable header sorts ascending, then descending, then back to the original order. Drag a header's right edge to resize it (double-click it to fit the content when your delegate implements `fit_column`), and drag a header sideways to move the column.++## Why it is fast++Blender's spreadsheet doesn't make a widget per cell. Each frame it works out which rows the scroll position shows (`first_row = scroll_y / row_height`, and `region_height / row_height + 1` of them), skips the columns that are off screen, and draws just those cells. BUI's table does the same:++- **Only visible cells are asked for.** `CellSource::cell` runs for the cells in view, never for the rest. The table has no per-row state, so building one costs nothing.+- **Cells are painted, not built.** There's no element, style or layout box per cell, so a frame builds the same handful of elements however many rows there are.+- **Sorting and filtering never copy rows.** They produce a list of row numbers (what Blender calls an index mask) and the table reads through it. A column of numbers or of text sorts through typed keys: one pass pulls an order-preserving integer out of each cell, then plain integer pairs are sorted on every core, with no call into your code per comparison.+- **A steady frame allocates nothing.** `cell` hands back a borrowed `&str` or a number that the table formats into a stack buffer, and the table's own drawing is covered by a test that counts allocations.+- **Nothing moves, nothing renders.** A table that isn't scrolling costs no CPU.++<BenchChart id="data-table-frame" />++The same 1,000,000 x 20 table, three ways, measured by `examples/bench_table.rs` (a 900x500 window; "frame" is the whole pipeline including the software raster). The last bar is a table built the obvious way, one element per cell, measured at 2,000 rows because it can't be measured at a million.++## One core, two frameworks++The table is split so that nothing is written twice. The `blenderui-table` crate has no dependencies and no framework: the visible-row math, column culling, the row index mask and the typed sorts, the selection model, keyboard navigation, column layout, Ctrl+C text, scrolling, hit testing, a bounded text-run cache, and the painting itself, which draws through a small `PaintSink` trait. A framework adapter adds three things and no logic: a `Host` that forwards your delegate's hooks and the redraw calls, a `PaintSink` that draws rectangles and text, and an element that hands pointer, wheel and key events to the core.++blenderui's own `table` module and the gpui adapter below are both such adapters, around the same `TableCore`.++## On gpui++`blenderui-table-gpui` is a `DataTable` for plain gpui with gpui-component's names (`TableDelegate`, `Column`, `ColumnSort`, `ColumnGroup`, `TableState`, `TableEvent`, `scroll_to_row`, `load_more` ...). It is a custom gpui `Element` that paints the visible cells with `Window::paint_quad` and shaped lines: two elements per frame, however many rows. It keeps shaped text in a cache keyed by text, color and size, so scrolling never reshapes a string it showed a frame ago.++```rust+use blenderui_table_gpui::*;++struct People;++impl CellSource for People {+ fn cell(&self, row: usize, col: usize) -> Cell<'_> {+ match col {+ 0 => Cell::U64(row as u64),+ 1 => Cell::Str(["Cube", "Sphere", "Torus"][row % 3]),+ _ => Cell::F64(row as f64 / 8.0, 2),+ }+ }+}++impl TableDelegate for People {+ fn columns_count(&self, _: &App) -> usize { 3 }+ fn rows_count(&self, _: &App) -> usize { 1_000_000 }+ fn column(&self, ix: usize, _: &App) -> Column {+ Column::new(format!("c{ix}"), ["ID", "Name", "Size"][ix]).sortable().width(px(110.0))+ }+}++// in render: div().size_full().child(DataTable::new(&self.table).stripe(true))+```++For a cell that needs real content, return `true` from `has_custom_cells` and `is_custom_cell(row, col)`, return `Cell::Empty` from `cell`, and build the element in `render_td`; only visible custom cells are built.++### Against gpui-component++Measured in a real window on the same gpui, with the same data, columns and row height, one process per library:++<BenchChart id="data-table-gpui" />++The frame time is the main thread's CPU time from render to the end of paint; it leaves out GPU work and the 60 Hz wait, which is why both show 60 FPS. The gaps are the point: about 3.3 times less time per scrolled frame, about 30 times fewer allocations, and a worse tail for the component (95th percentile 9 ms against 1.8 ms). The component's own text sort wins at 100,000 rows of text; ours wins on numbers there and on every sort at a million rows. Peak memory is higher here because sorting builds key pairs. Reproduce it with `cargo build --release --features bench --example bench_gpui -j 1` and `node bench/run.mjs` in `bindings/rust/blenderui-table-gpui`. GPU time and other machines are not measured.++## What you get++| Feature | How |+| --- | --- |+| Sticky header, pinned columns, horizontal and vertical scrolling | built in; `Column::fixed_left()` pins a column |+| Column resize, move, sort | drag a header border, drag a header, click a header |+| Row selection | click; Ctrl-click toggles; Shift-click extends; Ctrl+A selects all |+| Cell and column selection | `cell_selectable(true)`, `col_selectable(true)` (one at a time) |+| Keyboard | Up, Down, Page Up, Page Down, Home, End; Left and Right in cell and column modes; Escape clears |+| Copy | Ctrl+C puts the selected rows on the clipboard as tab-separated text |+| Stripes, row-number column, borders | `stripe(true)`, `row_header(true)`, `bordered(true)` |+| Row sizes | `Size::XSmall` to `Size::Large`, from Blender's `UI_UNIT_Y` and the UI scale |+| Loading and empty states | `loading()` shows a skeleton; `empty_text()` |+| More rows when scrolled to the end | `has_more`, `load_more_threshold`, `load_more` |+| Filter | `TableState::set_filter(|data, row| ...)` |+| Themes | Blender's dark and light themes, with HiDPI |++Events come as `TableEvent` values, the same names gpui-component uses (`SelectRow`, `DoubleClickedRow`, `ColumnWidthsChanged`, `MoveColumn`, `RightClickedRow` ...). Listen with `on_event`, or with `on_select`, `on_sort`, `on_row_double_click`, `on_column_resize` and `on_context_menu`:++```rust+DataTable::new(&table)+ .stripe(true)+ .on_select(|row, _window, _cx| println!("row {row}"))+ .on_sort(|col, sort, _, _| println!("column {col}: {sort:?}"))+```++## Porting from gpui-component++The names follow gpui-component's `TableDelegate`, `Column`, `ColumnSort`, `ColumnGroup`, `TableState` and `DataTable`: `columns_count`, `rows_count`, `column`, `perform_sort`, `fit_column`, `move_column`, `group_headers`, `loading`, `has_more`, `load_more`, `visible_rows_changed`, `visible_columns_changed`, `selected_row`, `set_selected_row`, `visible_range`, `scroll_to_row`, `scroll_to_col`, `headers` and `dump`. Two things differ on purpose:++- **Cells are values drawn by the table.** gpui-component's `render_td` returns an element for every visible cell on every frame; here `cell` returns a typed value (`Cell::U64`, `Cell::Str`, `Cell::F64(value, decimals)`) and the table draws it, which is what makes a frame cost the same at any size. On gpui, `render_td` remains as an opt-in for the few cells that need real elements. In blenderui, cells that hold widgets aren't supported yet.+- **The table sorts for you.** The cells' own order sorts an index list (override `CellSource::sort_kind` and `compare` for a custom order); the delegate's data is never reordered. If you'd rather sort your own data in `perform_sort`, return `false` from `sort_by_mask`.++Row numbers in events and in `selected_row` are your delegate's row numbers, so they stay right when the table is sorted or filtered.++## Long lists: `uniform_list`++For a list of equal-height items that are real elements (buttons, icons, rows with their own widgets), `uniform_list` takes gpui's signature and builds only the items in view:++```rust+uniform_list("files", 100_000, |range, _window, _cx| {+ range.map(|i| div().child(format!("File {i}"))).collect::<Vec<_>>()+})+.item_height(px(20.0))+.h(px(300.0))+```++It uses the same visible-range code as the table. The scroll offset is kept per id like any scrolling element, and the scrollbar is sized for all the items. Layout works in `f32`, so past about 16 million pixels of total height (a million 24 px rows) the position loses sub-pixel precision; the `DataTable` keeps its own offset in `f64` and has no such limit.++## Testing a table++Tables run off-screen like everything else, so your tests can click headers, drag borders and press keys. `tests/table.rs` does exactly that, on a million-row table; see [headless testing](../headless-testing/).++## Limitations++- **No element cells in blenderui yet** (the gpui adapter has the `render_td` escape hatch), and no popup context menu: right clicks arrive as `TableEvent::RightClickedRow`.+- **Selection after a sort or filter is cleared**, because selected rows are display positions.+- **Cell and column selection hold one cell or column**, not a range. Row selection takes ranges.+- **Column groups** (`group_headers`) draw, but aren't covered by a test yet.+- **JavaScript and Python wrappers: coming soon.** The table is built once, in Rust; the other languages will wrap it rather than reimplement it.+- **Damage rectangles inside the table aren't reported.** A scroll or hover redraws the table's canvas as a whole; the engine's damage rendering for the rest of the window is unchanged.diff --git a/website/src/content/docs/rust/virtual-list.mdx b/website/src/content/docs/rust/virtual-list.mdxnew file mode 100644index 0000000..2515098--- /dev/null+++ b/website/src/content/docs/rust/virtual-list.mdx@@ -0,0 +1,178 @@+---+title: Variable-height lists+description: A chat-grade virtualized list whose items have different heights, one design from 100 messages to 10 million. It has a two-level height index, scrolling anchored to an item, wrapped-text measuring on demand and a file-backed source, and is drawn the way Blender text view is drawn.+section: Rust+order: 66+languages: ["rust"]+sources: ["docs/rust.md", "bindings/rust/blenderui-vlist/src/lib.rs", "bindings/rust/blenderui-vlist/src/index/mod.rs", "bindings/rust/blenderui-vlist/src/index/block.rs", "bindings/rust/blenderui-vlist/src/index/fenwick.rs", "bindings/rust/blenderui-vlist/src/estimate.rs", "bindings/rust/blenderui-vlist/src/wrap.rs", "bindings/rust/blenderui-vlist/src/measure.rs", "bindings/rust/blenderui-vlist/src/source.rs", "bindings/rust/blenderui-vlist/src/log.rs", "bindings/rust/blenderui-vlist/src/list.rs", "bindings/rust/blenderui-vlist/src/chat.rs", "bindings/rust/blenderui-vlist/src/view/mod.rs", "bindings/rust/blenderui-vlist/src/view/frame.rs", "bindings/rust/blenderui-vlist/src/view/edit.rs", "bindings/rust/blenderui-vlist/tests/view.rs", "bindings/rust/blenderui-vlist/examples/bench_core.rs", "bindings/rust/blenderui-vlist/examples/bench_frames.rs", "bindings/rust/blenderui-paint/src/lib.rs", "bindings/rust/blenderui/src/vlist/mod.rs", "bindings/rust/blenderui/src/vlist/element.rs", "bindings/rust/blenderui/src/sink.rs", "bindings/rust/blenderui/tests/vlist.rs", "bindings/rust/blenderui/examples/site_chat.rs", "bindings/rust/blenderui-vlist-gpui/src/element.rs", "bindings/rust/blenderui-vlist-gpui/examples/bench_list_gpui.rs", "bindings/rust/blenderui-vlist-gpui/bench/run.mjs"]+---++A chat is the hard case for a list. Every message has its own height (a one-word reply, a paragraph, a screenshot), the height depends on how wide the window is, new messages arrive at the bottom while you read older ones, and history loads at the top. A list that only handles rows of equal height can't do it, and one that keeps a height for every message stops being cheap when there are ten million of them.++**`blenderui-vlist` is one design for all of it.** A hundred messages and ten million take the same code path. Only what you scrolled through costs memory, a frame paints only the messages in view straight to the screen, and what you are looking at doesn't move when the heights around it change.++<Figure+ shot="chat-list"+ alt="A chat: round colored avatars with a letter, a user name and a time above each run of messages, wrapped message text, a lighter blue band on one selected message, a thin scrollbar at the right and a status line below saying 20000 messages, showing 19993..19999"+ caption="A chat opened at its newest message, one message selected (<code>examples/site_chat.rs</code>)."+/>++## A chat in 20 lines++You give the list your messages and keep its state in an entity. `chat_list` is the element; a click on a message selects it.++<Tabs sync="rust-syntax" label="Rust syntax">+<Tab label="rsx!">++```rust+use blenderui::prelude::*;+use blenderui::vlist::{chat_list, synth, theme_palette, ChatList, ChatStyle, ListState, Options, VecSource};++struct Chat { list: Entity<ListState<VecSource, ChatStyle>> }++impl Render for Chat {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ rsx! {+ <div class="w-full h-full">+ {chat_list(&self.list)}+ </div>+ }+ }+}++// when opening the window: open at the newest message, follow new ones+let opts = Options { start_at_end: true, ..Options::default() };+let messages = ChatList::from_messages(synth::messages(0, 1_000_000), theme_palette(), 760.0, 436.0, opts);+let list = cx.new(|cx| ListState::new(messages, cx));+// from anywhere: list.update(cx, |s, _| s.push(message));+```++</Tab>+<Tab label="gpui builders">++```rust+use blenderui::prelude::*;+use blenderui::vlist::{chat_list, synth, theme_palette, ChatList, ChatStyle, ListState, Options, VecSource};++struct Chat { list: Entity<ListState<VecSource, ChatStyle>> }++impl Render for Chat {+ fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {+ div().size_full().child(chat_list(&self.list))+ }+}++let opts = Options { start_at_end: true, ..Options::default() };+let messages = ChatList::from_messages(synth::messages(0, 1_000_000), theme_palette(), 760.0, 436.0, opts);+let list = cx.new(|cx| ListState::new(messages, cx));+// from anywhere: list.update(cx, |s, _| s.push(message));+```++</Tab>+</Tabs>++A `Message` is an id, a time, a sender, some flags, an optional image height and the text. Whether a message starts a new run (and shows the avatar and name) or a new day (and shows a date divider) is decided when you `push` it and kept in the message's flags, so a message's height depends on that message alone and any message can be measured without its neighbours.++The same crate lists anything else: build a `List` from your own `ItemSource` (where the items come from), `Measurer` (how an item lays out) and `ItemPainter` (how it looks).++## One index for every size++The core of the list is `HeightIndex`, which answers two questions fast: *which item is at this pixel offset*, and *how far down is this item*. Blender's own text view answers them by walking and wrapping lines every frame (`textview_draw` in `space_info/textview.cc`), which is linear in the number of lines. A table of running totals (`OffsetIndices`, `BLI_offset_indices.hh`) is cheap to read but has to be rebuilt whenever one height changes. The index here is the updatable version of the second idea, in two levels:++```text+ top level: a Fenwick tree over blocks+ spare slots ........................ spare slots+ [ . . . ][ B0 ][ B1 ][ B2 ] ... [ Bk ][ . . . ]+ | | | |+ each block holds up to 1024 consecutive items:+ Uniform count, one height (equal rows)+ Estimated count, text bytes (never looked at)+ Measured prefix sums, one bit/item (scrolled through)+```++- **Blocks are cheap until you look at them.** A block nobody scrolled to is a count and a byte total, about 40 bytes for 512 messages. Looking at it measures the messages in view and turns that one block into prefix sums (4 bytes per message). Memory follows what was scrolled through, not the length.+- **One block is a flat array.** A list of up to 1024 items is a single block and the tree is skipped, so a hundred messages cost what a plain array of running totals costs.+- **Equal rows cost nothing.** A list built with `ListView::uniform` is `Uniform` blocks: ten million 24 px rows are a few hundred kilobytes, and a block turns into prefix sums only when an item of a different height arrives.+- **Both ends are cheap.** The tree has spare slots on both sides, so adding a page of older history or a new message adds a block without shifting anything; the tree doubles when a side fills up.+- **A height change costs O(log blocks).** The new height adds a delta to the block's running totals, then up the tree. Setting many at once (`set_heights`) touches each block once.+- **Heights are integers.** One unit is 1/64 px, in a `u32` per item and a `u64` for offsets, so ten million 60 px rows (600 million px) stay exact; `f32` stops being exact at about 16 million px. Bad input (NaN, negative, huge) is clamped at the one function that converts.+- **A new width forgets, lazily.** Wrapped text has different heights at another width, so a resize turns every measured block back into an estimate (and releases its memory); the messages in view are measured again as they are drawn.++Estimates are not guesses: `pad + lines x line height`, with the lines worked out from the text bytes and the wrap width, and a calibration factor that every real measurement adjusts. The scrollbar of a list nobody has scrolled yet is about right, and converges as you read.++## Scrolling that doesn't jump++The position isn't a pixel offset. It is **an anchor**: the item at the top of the viewport and how far into it the viewport starts. Items are drawn relative to the anchor in small coordinates, which gives the behaviour a chat needs:++- A height changing above the viewport (an image arrived, a block got measured) can't move what you see, because nothing you see is positioned from there.+- Prepending a page of older history doesn't jump: the anchor moves with its item.+- **Stick to bottom** keeps the end of the list at the bottom edge while new messages arrive, stops when you scroll up, and starts again when you scroll back to the end. It is a second kind of position (the end, with no anchor), so opening a ten-million-message chat at the newest message touches only the last screenful.+- Streaming text into the last message re-measures one message per frame, however many tokens arrived.+- `jump_to(item, Align::Center)` (or `jump_to_id`) takes O(log blocks) plus one page, and re-aims each frame until the target is measured, so estimates between here and there can't leave it off.+- Dragging the scrollbar far picks an anchor from the estimate. Measuring what lands there doesn't move the anchor, so nothing fights the pointer; only the thumb adjusts.++The keyboard (PageUp, PageDown, arrows, Home, End), the wheel and trackpad (a notched wheel eases in over a few frames, a trackpad applies directly) and a Blender-style scrollbar are in the core, so every framework behaves the same. An idle list asks for no frames.++## Measuring without laying out++Heights come from a `Measurer`: how wide an item's text may be, and how tall everything that isn't text is. The wrapping is Blender's `textview_wrap_offsets` in pixels. It makes one pass over the text and records where each line starts, and the result is cached per text, width and size in the same bounded, generation-tagged cache the data table uses for text runs (Blender's glyph cache design). Plain ASCII, which is nearly all chat, is measured from a per-character advance table filled lazily from your text engine, so a message costs a table lookup per byte rather than a call into the shaper. Other characters are measured one at a time and remembered.++A frame measures what is in view and nothing else. While you fling, it has a budget (half a millisecond by default); messages it couldn't measure keep their estimated height and are drawn as a skeleton, and the next frames catch up. When the list is idle, `prefetch` measures ahead of the scroll direction, so a flick finds the next screens measured. Images and embeds carry their height in the record, so their loading shifts nothing.++## Where the items come from++An `ItemSource` is `len`, the text bytes in a range (so an estimate needs no per-item data), `fetch` of a range into a reusable buffer, and the id of an item and the item of an id. `ensure_loaded` and `cancel` are the hooks for items that load asynchronously: the list asks for what is on screen only when you are not flinging, and cancels what it no longer needs. Two sources are included:++- `VecSource`: messages in memory, with `push`, `prepend`, `set_text` and `remove`.+- `log::LogSource`: a file-backed, append-only log. Each message is a fixed 16-byte record plus text in an arena, read with positioned reads (`seek_read` on Windows, `read_at` on Unix) so a read costs the same at message 10 as at message 10 million. Building the index over it needs two 8-byte reads per block, because the byte total of a range is a subtraction. Ten million messages are 1.1 GB on disk and a few megabytes in memory.++## Measured++All numbers are on a Ryzen 7 5800U laptop (8 cores, 16 GB), Windows 11, release builds, on AC power with other programs open. They are medians of 3 runs, one process per run. The code is in `blenderui-vlist/examples` and `blenderui-vlist-gpui`.++**The index against a flat `Vec` of running totals** (`bench_core`), the simplest correct implementation. Both are O(1) per item to read; the flat `Vec` pays O(n) to change a height.++<BenchChart id="vlist-index" />++At 100 items, the one-block index costs about 20 ns more per frame than the flat array (a frame's lookups: find the first item and read 30 heights: 53 ns against 34 ns), a few thousandths of a percent of a 60 Hz frame. From 10,000 items, changing one height or adding a page of history is 13 to 20,000 times cheaper than the flat array, and the untouched list costs about 0.1 byte per item.++**Whole frames of the core** (`bench_frames`): layout and paint of the chat into a counting sink, so this is the list's own cost, without a text engine or a rasterizer (the adapters add theirs).++<BenchTable id="vlistFrames" />++**On real gpui, against gpui's own `list` and gpui-component's `virtual_list`** (`bench_list_gpui`): the same chat messages, the same window, one process per library and size. A frame is the main thread's time from the start of the root view's render to the end of paint; GPU submission and the 60 Hz wait are not in it.++<BenchChart id="vlist-scroll" />++<BenchChart id="vlist-memory" />++<BenchChart id="vlist-setup" />++<Callout type="note" title="How to read the head-to-head">+`virtual_list` needs the height of every item up front, so its setup includes measuring all of them (with a cheap synthetic text width, which favours it: its rows may wrap differently from what it draws). gpui's `list` measures real elements. Ours measures with gpui's own text shaper. A process is stopped, and the run reported as failed, when it passes 4 GB above its data or 150 seconds; the numbers up to that point are in the table.+</Callout>++## What is shared++The list is split so that nothing is written twice:++| Crate | What it holds |+| --- | --- |+| `blenderui-paint` | Geometry and colors, the `PaintSink` trait a framework implements once, the theme `Palette`, the bounded `TextCache`, and the test helpers. Both view cores depend on it. |+| `blenderui-table` | The data table core. |+| `blenderui-vlist` | The height index, the view (anchor, frame, scrolling), the measuring and wrapping, the sources and the chat look. `std` only. |+| `blenderui` (`vlist`, `sink`) | The adapter: an entity, an element, the engine's `PaintSink` (shared with the table), input events. |+| `blenderui-paint-gpui`, `blenderui-vlist-gpui` | The gpui `PaintSink` (shared with the table) and the gpui element. Outside the main workspace because gpui is a huge build. |++An adapter holds no list logic. It owns a `List`, forwards pointer, wheel and key events, lays a frame out while rendering (which measures, so it needs the text engine and mutable access) and paints from the result with read-only access.++## Limitations++- **Selecting text across messages** is not built; whole messages can be selected.+- **A background thread measuring ahead** is not built. Prefetch runs on the UI thread in idle time, under a budget. Results are applied between frames, so nothing races, but a very slow shaper still spends UI time.+- **Damage regions.** A scroll repaints the list's whole canvas. Reusing the previous frame and painting only the newly exposed strip needs engine support the adapters don't use yet.+- **Complex scripts** are measured per character in the fast path and shaped properly when painted by the engine, so a line of Arabic or emoji sequences can wrap a pixel or two differently from how it draws.+- **One height clamp.** An item can be at most 16,384 px tall.+- **Group headers after a prepend.** The message that was first before a page of older history was prepended keeps the header it had; recompute its flags if your history can continue a run.+- **No bottom alignment for short lists.** A list shorter than the viewport sits at the top.+- **JavaScript and Python wrappers: coming soon.** The list is built once, in Rust.diff --git a/website/src/data/bench.ts b/website/src/data/bench.tsindex 9ebc7e4..9452036 100644--- a/website/src/data/bench.ts+++ b/website/src/data/bench.ts@@ -6,85 +6,85 @@// <BenchTable id="startup" /> just the exact table// The ids are the keys of `charts` and `tables` below.-export const machine = "Ryzen 7 5800U laptop, Windows 11, on AC power";+export const machine = "Ryzen 7 5800U laptop, Windows 11, on AC power"export const benchCaveat =- "Measured before the latest features (ImGui, the Linux GPU renderer, the Blender search and expression code) landed. Your numbers will differ; the tools ship with the repo.";+ "Measured before the latest features (ImGui, the Linux GPU renderer, the Blender search and expression code) landed. Your numbers will differ; the tools ship with the repo."export const sources = {readme: "README.md#performance",rust: "bindings/rust/bench/README.md",js: "docs/javascript.md#performance",-} as const;+} as const/** One row of a bar chart. `display` is the text shown (defaults to the value + unit). */export interface Bar {- label: string;+ label: string/** Smaller second line under the label, e.g. the renderer. */- sub?: string;- value: number;- display?: string;+ sub?: string+ value: number+ display?: string/** BUI's own bars are drawn in Blender blue; the rest in grey. */- ours?: boolean;+ ours?: boolean}export interface Series {- name: string;- ours?: boolean;+ name: string+ ours?: boolean}/** A grouped chart: one group per category, one bar per series. `null` = not measured. */export interface Group {- label: string;- sub?: string;- values: (number | null)[];- display?: (string | null)[];+ label: string+ sub?: string+ values: (number | null)[]+ display?: (string | null)[]}export interface Table {- caption: string;- columns: string[];+ caption: string+ columns: string[]/** Cells may contain <strong>. First cell is the row header. */- rows: string[][];+ rows: string[][]/** Column indexes to right-align (numbers). */- numeric?: number[];- note?: string;+ numeric?: number[]+ note?: string}interface ChartBase {- title: string;+ title: string/** What's measured, in one line under the title. */- subtitle?: string;- unit: string;- better: "lower" | "higher";+ subtitle?: string+ unit: string+ better: "lower" | "higher"/** The one-glance takeaway, e.g. { value: "40×", text: "sooner first frame than gpui" }. */- headline?: { value: string; text: string };+ headline?: { value: string; text: string }/** Id of the exact table in `tables`, revealed by "Open bench". */- table: TableId;- source: string;+ table: TableId+ source: string}export interface BarSpec extends ChartBase {- kind: "bars";- bars: Bar[];+ kind: "bars"+ bars: Bar[]}export interface GroupSpec extends ChartBase {- kind: "groups";- series: Series[];- groups: Group[];+ kind: "groups"+ series: Series[]+ groups: Group[]}export interface LineSpec extends ChartBase {- kind: "line";+ kind: "line"/** x positions, in order (e.g. cell counts). */- x: number[];- xLabel: string;- lines: { name: string; ours?: boolean; values: number[] }[];+ x: number[]+ xLabel: string+ lines: { name: string; ours?: boolean; values: number[] }[]}-export type ChartSpec = BarSpec | GroupSpec | LineSpec;+export type ChartSpec = BarSpec | GroupSpec | LineSpecconst ratio = (a: number, b: number) => {- const r = a / b;- return `${r >= 10 ? Math.round(r) : Math.round(r * 10) / 10}×`;-};+ const r = a / b+ return `${r >= 10 ? Math.round(r) : Math.round(r * 10) / 10}×`+}// ---------------------------------------------------------------------------------------// The exact tables@@ -106,7 +106,14 @@ const tablesBase = {["", "GPU", "159 ms", "157 ms", "43 MB", "2.4 ms"],["Qt syntax (Python)", "CPU", "156 ms", "123 ms", "27 MB", "0 ms"],["", "GPU", "161 ms", "160 ms", "36 MB", "1.2 ms"],- ["<strong>Same gpui code:</strong> blenderui", "CPU", "<strong>40 ms</strong>", "<strong>27 ms</strong>", "<strong>15 MB</strong>", "<strong>0 ms</strong>"],+ [+ "<strong>Same gpui code:</strong> blenderui",+ "CPU",+ "<strong>40 ms</strong>",+ "<strong>27 ms</strong>",+ "<strong>15 MB</strong>",+ "<strong>0 ms</strong>",+ ],["blenderui", "GPU", "43 ms", "60 ms", "31 MB", "2.1 ms"],["gpui", "GPU", "231 ms", "226 ms", "29 MB", "743 ms"],["gpui-fast", "GPU", "226 ms", "217 ms", "31 MB", "2.5 ms"],@@ -155,7 +162,13 @@ const tablesBase = {columns: ["", "First frame", "Launch to exit", "RAM at first frame", "What you ship"],numeric: [1, 2, 3, 4],rows: [- ["<strong>QuickJS executable</strong> (bui build)", "<strong>68 ms</strong>", "<strong>104 ms</strong>", "<strong>19 MB</strong>", "<strong>4.9 MB</strong>"],+ [+ "<strong>QuickJS executable</strong> (bui build)",+ "<strong>68 ms</strong>",+ "<strong>104 ms</strong>",+ "<strong>19 MB</strong>",+ "<strong>4.9 MB</strong>",+ ],["Bun executable (bui build --bun)", "79 ms", "147 ms", "35 MB", "114 MB"],["Bun (bun app.js)", "80 ms", "152 ms", "35 MB", "Bun + your app"],["Node.js (node app.js)", "108 ms", "187 ms", "45 MB", "Node + your app"],@@ -169,7 +182,12 @@ const tablesBase = {numeric: [1, 2, 3],rows: [["Rust", "59.6", "<strong>12.0 ms</strong>", "<strong>43 MB</strong>"],- ["QuickJS: plain JS / React with signals / React with state", "59.1 / 58.7 / 19.7", "16.3 / 14.9 / 51.0 ms", "<strong>56 / 61 / 67 MB</strong>"],+ [+ "QuickJS: plain JS / React with signals / React with state",+ "59.1 / 58.7 / 19.7",+ "16.3 / 14.9 / 51.0 ms",+ "<strong>56 / 61 / 67 MB</strong>",+ ],["Bun 1.4: plain JS / React with signals / React with state", "58.8 / 58.4 / 55.8", "13.1 / 13.3 / 20.8 ms", "80 / 85 / 118 MB"],["Node 22: plain JS / React with signals / React with state", "55.8 / 56.7 / 54.8", "14.4 / 14.0 / 18.9 ms", "88 / 93 / 121 MB"],],@@ -186,16 +204,168 @@ const tablesBase = {["Node: plain JS / React with signals / React with state", "60 / 60 / 60", "5.6 / 5.6 / 6.9 ms", "68 / 71 / 97 MB"],],},-} satisfies Record<string, Table>;+ dataTableGpui: {+ caption:+ "Data table on real gpui: this crate vs gpui-component 0.9.0, 1,000,000 rows x 20 columns, 1200x700 table in a 1280x740 window (bindings/rust/blenderui-table-gpui, examples/bench_gpui.rs, release build, Direct3D 11)",+ columns: ["", "blenderui-table-gpui", "gpui-component 0.9.0", "Empty window (no table)"],+ numeric: [1, 2, 3],+ rows: [+ ["Scroll frame, render to end of paint, median", "<strong>1.45 ms</strong>", "4.75 ms", "0.15 ms"],+ ["Scroll frame, 95th / 99th percentile", "<strong>1.77 / 2.11 ms</strong>", "8.99 / 9.58 ms", "0.26 / 0.30 ms"],+ ["Frames per second under continuous scrolling", "60.1", "60.0", "60.1"],+ ["Process CPU per frame (all threads)", "<strong>4.6 ms</strong>", "8.9 ms", "1.0 ms"],+ ["Heap allocations per scrolled frame", "<strong>259</strong>", "7,623", "102"],+ ["Heap allocations per repainted frame (no scroll)", "<strong>136</strong>", "7,416", "102"],+ ["Selection (click) to painted, CPU", "<strong>1.05 ms</strong>", "5.27 ms", "-"],+ ["Keyboard (Down) to painted, CPU", "<strong>1.63 ms</strong>", "8.85 ms", "-"],+ ["Sort 1,000,000 rows by a number", "<strong>37 ms</strong>", "140 ms", "-"],+ ["Sort 1,000,000 rows by text", "<strong>38 ms</strong>", "57 ms", "-"],+ ["First frame (window creation dominates)", "431 ms", "445 ms", "438 ms"],+ ["Memory above the data and the empty runtime", "42 MB", "42 MB", "-"],+ ["Peak working set", "231 MB", "192 MB", "-"],+ ["100,000 x 8: scroll frame median", "<strong>1.24 ms</strong>", "4.02 ms", "-"],+ ["100,000 x 8: sort by a number / by text", "<strong>4.2 / 6.8 ms</strong>", "8.6 / <strong>3.9 ms</strong>", "-"],+ ],+ note: "Ryzen 7 5800U laptop (8 cores), 15 GB, Windows 11; the GPU is whatever gpui picks on the default Direct3D 11 adapter. One process per library, median of 3 runs. Frame time is the main thread from the start of the root view's render to the end of the table's paint (elements, layout, prepaint, paint); GPU submission and the 60 Hz vsync wait are not in it, so both libraries show 60 FPS and the difference is CPU time. Scrolling is two rows per frame, driven the same way for both. Allocations come from a counting global allocator on the UI thread. Select and key inject real events through Window::dispatch_event and count the dispatch plus the next frame. Both tables hold the same data (columnar, generated once) and the same 110 px columns and 32 px rows; the component sorts its own row index with sort_by in perform_sort, as its examples sort their data, while this crate sorts a row mask with typed keys on every core. At 100,000 rows the component's plain single-threaded sort wins on text. This crate's peak memory is higher because sorting builds key pairs. Not measured: GPU time, a different GPU, other platforms.",+ },+ dataTable: {+ caption: "Rust data table, 1,000,000 rows x 20 columns in a 900x500 window (examples/bench_table.rs, release build, software raster)",+ columns: ["", "DataTable (painted)", "uniform_list rows", "One element per cell"],+ numeric: [1, 2, 3],+ rows: [+ ["Rows measured", "1,000,000", "1,000,000", "2,000"],+ ["Build", "<strong>0.17 ms</strong>", "-", "-"],+ ["First frame", "<strong>6-8 ms</strong>", "13 ms", "2,800 ms"],+ ["Scroll frame", "<strong>1.1 ms</strong>", "3.1 ms", "1,735 ms"],+ ["Heap allocations per frame (whole pipeline)", "<strong>48</strong>", "5,186", "780,467"],+ ["Allocations in the table's own drawing", "<strong>0</strong>", "-", "-"],+ ["Memory added (working set)", "<strong>17 MB</strong>", "19 MB", "138 MB"],+ ["Sort 1,000,000 rows by a column (header click, includes the repaint)", "<strong>22 ms</strong>", "-", "-"],+ ],+ note: "Frame times are the whole pipeline: render, layout, paint and the software raster. One element per cell was measured at 2,000 rows (a million would need about 70 GB and over ten minutes per frame; its cost grows linearly with rows). Allocation counts come from a counting global allocator; the table's drawing allocates nothing in steady state (a unit test asserts it). The same table on real gpui against gpui-component is in the next chart.",+ },+ vlistIndex: {+ caption:+ "Height index against a flat Vec of running totals, medians of 5 runs of a batch (bindings/rust/blenderui-vlist, examples/bench_core.rs, release build)",+ columns: ["Items", "What", "HeightIndex", "Flat Vec"],+ numeric: [2, 3],+ rows: [+ ["100", "A frame's lookups: find an item, read 30 heights", "53 ns", "34 ns"],+ ["100", "Set one height / set the last item", "22 / 11 ns", "15 / 1.4 ns"],+ ["10,000", "Set one height, random item", "<strong>53 ns</strong>", "684 ns"],+ ["10,000", "Prepend a 500-item page", "<strong>0.3 us</strong>", "17 us"],+ ["1,000,000", "Item at a pixel offset (all measured, random)", "136 ns", "63 ns"],+ ["1,000,000", "Set one height, random item", "<strong>112 ns</strong>", "81,849 ns"],+ ["1,000,000", "Prepend a 500-item page", "<strong>0.1 us</strong>", "1,838 us"],+ ["1,000,000", "Build with nothing measured / heap per item", "<strong>0.19 ms / 0.13 B</strong>", "needs every height / 8 B"],+ ["1,000,000", "Heap after touching only the last 60 items", "<strong>189 KB</strong>", "8 MB"],+ ["10,000,000", "Item at a pixel offset (all measured, random)", "536 ns", "387 ns"],+ ["10,000,000", "Set one height, random item", "<strong>182 ns</strong>", "3,825,956 ns"],+ ["10,000,000", "Prepend a 500-item page", "<strong>0.1 us</strong>", "26,647 us"],+ ["10,000,000", "Build with nothing measured / heap per item", "<strong>0.86 ms / 0.12 B</strong>", "needs every height / 8 B"],+ ],+ note: "Single-threaded, inputs seeded. Heap is live bytes from a counting allocator. Reading is where the flat array wins (about 1.5 times faster to find an item by offset when everything is measured, and far faster at 100 items in absolute ns); changing anything is where it loses. Not measured: other machines.",+ },+ vlistFrames: {+ caption:+ "Core frame cost: layout and paint of a chat into a counting sink, medians of 3 runs, 600 px viewport, 57 px scrolled per frame (examples/bench_frames.rs, bench/run.mjs)",+ columns: [+ "Items (source)",+ "Index build",+ "First frame",+ "Scroll frame p50 / p99",+ "Settled frame p50",+ "Jump p50",+ "Allocations per frame (scroll / settled)",+ "Working set",+ ],+ numeric: [1, 2, 3, 4, 5, 6, 7],+ rows: [+ ["100 (memory)", "0.0 ms", "50 us", "4.0 / 4.9 us", "4.0 us", "3.9 us", "0.02 / 0", "2 MB"],+ ["10,000 (memory)", "0.3 ms", "48 us", "4.7 / 10.9 us", "3.5 us", "13 us", "2.2 / 0", "5 MB"],+ ["1,000,000 (memory)", "19 ms", "61 us", "4.7 / 11.0 us", "3.8 us", "27 us", "2.2 / 0", "205 MB (the messages)"],+ ["1,000,000 (file log)", "8 ms", "71 us", "4.9 / 15 us", "4.1 us", "37 us", "2.2 / 0", "<strong>2 MB</strong>"],+ ["10,000,000 (file log)", "79 ms", "78 us", "4.8 / 19 us", "2.7 us", "36 us", "2.3 / 0", "<strong>3.6 MB</strong>"],+ ],+ note: "The sink only counts calls and the text width is a length times a constant, so this is the list's own cost, not a text engine's or a rasterizer's. The scroll allocations are the two a newly measured message needs (its cache entry); a frame that shows messages already measured allocates nothing. The file log was just written, so its pages come from the operating system's cache. Streaming a token into the last message (edit, layout, paint) takes about 20 us.",+ },+ vlistGpui: {+ caption:+ "Variable-height list on real gpui 0.3.11: this crate against gpui's list (SumTree) and gpui-component 0.9.0's virtual_list, 700x600 chat, medians of 3 runs, one process per run (bindings/rust/blenderui-vlist-gpui, examples/bench_list_gpui.rs)",+ columns: [+ "Items",+ "Library",+ "Setup",+ "First frame",+ "Scroll frame p50 / p95 / p99",+ "Allocations per frame",+ "RAM above the empty window",+ "Jump p50",+ ],+ numeric: [2, 3, 4, 5, 6, 7],+ rows: [+ [+ "100",+ "<strong>blenderui-vlist</strong>",+ "0 ms",+ "508 ms",+ "<strong>0.54 / 0.84 / 0.92 ms</strong>",+ "<strong>134</strong>",+ "0 MB",+ "<strong>0.53 ms</strong>",+ ],+ ["", "gpui list", "0 ms", "515 ms", "1.00 / 1.39 / 1.47 ms", "793", "0 MB", "1.83 ms"],+ ["", "virtual_list", "0.1 ms", "496 ms", "1.04 / 1.46 / 1.56 ms", "923", "0 MB", "1.94 ms"],+ [+ "10,000",+ "<strong>blenderui-vlist</strong>",+ "0 ms",+ "501 ms",+ "<strong>0.69 / 1.12 / 1.46 ms</strong>",+ "<strong>152</strong>",+ "5 MB",+ "<strong>1.41 ms</strong>",+ ],+ ["", "gpui list", "0.6 ms", "506 ms", "1.30 / 1.70 / 1.86 ms", "939", "1 MB", "2.60 ms"],+ ["", "virtual_list", "8.4 ms", "507 ms", "1.26 / 1.72 / 1.85 ms", "1,035", "0 MB", "2.10 ms"],+ [+ "1,000,000",+ "<strong>blenderui-vlist</strong>",+ "0.3 ms",+ "<strong>224 ms</strong>",+ "<strong>0.71 / 1.16 / 1.39 ms</strong>",+ "<strong>152</strong>",+ "2 MB",+ "<strong>1.47 ms</strong>",+ ],+ ["", "gpui list", "58 ms", "371 ms", "1.32 / 1.78 / 1.89 ms", "982", "86 MB", "2.58 ms"],+ ["", "virtual_list", "628 ms", "836 ms", "1.30 / 1.76 / 1.91 ms", "1,091", "10 MB", "2.15 ms"],+ [+ "10,000,000 (file log)",+ "<strong>blenderui-vlist</strong>",+ "82 ms",+ "<strong>591 ms</strong>",+ "<strong>0.74 / 1.22 / 1.44 ms</strong>",+ "<strong>153</strong>",+ "<strong>6 MB</strong>",+ "<strong>1.54 ms</strong>",+ ],+ ["", "gpui list", "537 ms", "1,995 ms", "1.44 / 1.87 / 2.03 ms", "957", "910 MB", "2.82 ms"],+ ["", "virtual_list", "7,285 ms", "7,843 ms", "1.30 / 1.82 / 2.17 ms", "984", "151 MB", "2.23 ms"],+ ],+ note: "Ryzen 7 5800U laptop, 16 GB, Windows 11, Direct3D 11. Frame time is the main thread from the start of the root view's render to the end of paint; GPU submission and the 60 Hz wait are not in it (all three show 60 FPS). Scrolling is 57 px per frame, driven the same way for all three; the empty window with the same harness takes 0.13 ms and 102 allocations per frame. RAM is the working set after the scroll minus the same window with 100 items (about 29 MB) and minus the data. Nobody hit the 4 GB or 150 s limits, so there are no failures to report: gpui's list held ten million items in 910 MB and virtual_list took 7.3 s to build its size table. virtual_list's sizes come from a cheap synthetic text width, which favours it. Our first frame at 100 and 10,000 items is window creation. Not measured: GPU time, other machines, selection and keyboard latency, streaming updates on the competitors. The machine was in normal use during the runs.",+ },+} satisfies Record<string, Table>-const withoutRust = (t: Table, caption: string): Table => ({ ...t, caption, rows: t.rows.filter((r) => !r[0].startsWith("Rust")) });+const withoutRust = (t: Table, caption: string): Table => ({ ...t, caption, rows: t.rows.filter((r) => !r[0].startsWith("Rust")) })/** The base tables plus narrower views of them, for pages about one language. */export const tables = {...tablesBase,/** The startup table's last rows: one gpui-syntax file compiled against each library. */startupGpui: {- caption: "Start time, the same gpui-syntax file (bindings/rust/bench/common/settings.rs) compiled against each library: median of 10 launches, process start to first frame",+ caption:+ "Start time, the same gpui-syntax file (bindings/rust/bench/common/settings.rs) compiled against each library: median of 10 launches, process start to first frame",columns: ["Same gpui code", ...tablesBase.startup.columns.slice(1)],numeric: tablesBase.startup.numeric,rows: tablesBase.startup.rows.slice(-4).map((r, i) => (i === 0 ? ["<strong>blenderui</strong>", ...r.slice(1)] : r)),@@ -204,9 +374,9 @@ export const tables = {jsStartupJs: withoutRust(tablesBase.jsStartup, tablesBase.jsStartup.caption),jsAnim3000Js: withoutRust(tablesBase.jsAnim3000, tablesBase.jsAnim3000.caption),jsAnim1000Js: withoutRust(tablesBase.jsAnim1000, tablesBase.jsAnim1000.caption),-} satisfies Record<string, Table>;+} satisfies Record<string, Table>-export type TableId = keyof typeof tables;+export type TableId = keyof typeof tables// ---------------------------------------------------------------------------------------// Charts@@ -217,14 +387,14 @@ const gpuiSame = (v: [number, number, number, number], d?: [string, string, stri{ label: "blenderui", sub: "GPU renderer", value: v[1], display: d?.[1], ours: true },{ label: "gpui-fast", sub: "GPU", value: v[3], display: d?.[3] },{ label: "gpui", sub: "Zed's, GPU", value: v[2], display: d?.[2] },-];+]const cells = (v: [number, number, number, number], d?: [string, string, string, string]): Bar[] => [{ label: "blenderui", sub: "GPU renderer", value: v[0], display: d?.[0], ours: true },{ label: "blenderui", sub: "CPU renderer", value: v[1], display: d?.[1], ours: true },{ label: "gpui-fast", value: v[2], display: d?.[2] },{ label: "gpui", value: v[3], display: d?.[3] },-];+]export const charts = {"first-frame": {@@ -288,10 +458,7 @@ export const charts = {subtitle: "The same small settings window written five ways; median of 10 launches",unit: "ms",better: "lower",- series: [- { name: "CPU renderer", ours: true },- { name: "GPU renderer" },- ],+ series: [{ name: "CPU renderer", ours: true }, { name: "GPU renderer" }],groups: [{ label: "Rust", sub: "HTML + CSS", values: [38, 42] },{ label: "JavaScript", sub: "React, Node.js", values: [94, 99] },@@ -358,12 +525,7 @@ export const charts = {subtitle: "gpui's numbers don't include its GPU time",unit: "ms",better: "lower",- series: [- { name: "blenderui GPU", ours: true },- { name: "blenderui CPU", ours: true },- { name: "gpui-fast" },- { name: "gpui" },- ],+ series: [{ name: "blenderui GPU", ours: true }, { name: "blenderui CPU", ours: true }, { name: "gpui-fast" }, { name: "gpui" }],groups: [{ label: "100 cells", values: [1.2, 4.6, 2.7, 4.7] },{ label: "1000 cells", values: [4.7, 10.2, 20.5, 27.7] },@@ -401,6 +563,36 @@ export const charts = {table: "frameTimes",source: sources.readme,},+ "data-table-frame": {+ kind: "bars",+ title: "Rust data table: scroll frame, 1,000,000 rows x 20 columns",+ subtitle: "Whole frame, 900x500 window, software raster. One element per cell: 2,000 rows",+ unit: "ms",+ better: "lower",+ headline: { value: "1.1 ms", text: "per scrolled frame at a million rows" },+ bars: [+ { label: "DataTable", sub: "painted like Blender's spreadsheet", value: 1.1, display: "1.1 ms", ours: true },+ { label: "uniform_list", sub: "20 cell elements per visible row", value: 3.1, display: "3.1 ms", ours: true },+ { label: "One element per cell", sub: "2,000 rows only", value: 1735, display: "1,735 ms" },+ ],+ table: "dataTable",+ source: "bindings/rust/blenderui/examples/bench_table.rs",+ },+ "data-table-gpui": {+ kind: "bars",+ title: "gpui: scroll frame, 1,000,000 rows x 20 columns",+ subtitle: "Main thread, render to end of paint, median of 3 runs, real window",+ unit: "ms",+ better: "lower",+ headline: { value: "3.3x", text: "less CPU per scrolled frame than gpui-component" },+ bars: [+ { label: "blenderui-table-gpui", sub: "paints visible cells", value: 1.45, display: "1.45 ms", ours: true },+ { label: "gpui-component 0.9.0", sub: "an element per cell", value: 4.75, display: "4.75 ms" },+ { label: "Empty window", sub: "the framework alone", value: 0.15, display: "0.15 ms" },+ ],+ table: "dataTableGpui",+ source: "bindings/rust/blenderui-table-gpui/bench/results.md",+ },"js-first-frame": {kind: "bars",title: "JavaScript: first frame",@@ -423,11 +615,7 @@ export const charts = {subtitle: "One cell changes per frame; GPU renderer",unit: "ms",better: "lower",- series: [- { name: "Plain JS", ours: true },- { name: "React + signals", ours: true },- { name: "React + state" },- ],+ series: [{ name: "Plain JS", ours: true }, { name: "React + signals", ours: true }, { name: "React + state" }],groups: [{ label: "QuickJS", values: [16.3, 14.9, 51.0] },{ label: "Bun 1.4", values: [13.1, 13.3, 20.8] },@@ -436,9 +624,73 @@ export const charts = {table: "jsAnim3000",source: sources.readme,},-} satisfies Record<string, ChartSpec>;+ "vlist-scroll": {+ kind: "groups",+ title: "Variable-height list: scroll frame (median)",+ subtitle: "Real gpui window, chat messages, main thread from render to end of paint, median of 3 runs",+ unit: "ms",+ better: "lower",+ headline: { value: "about 2x", text: "faster per scrolled frame at 100, 1M and 10M messages" },+ series: [{ name: "blenderui-vlist", ours: true }, { name: "gpui list" }, { name: "gpui-component virtual_list" }],+ groups: [+ { label: "100", values: [0.54, 1.0, 1.04] },+ { label: "1,000,000", values: [0.71, 1.32, 1.3] },+ { label: "10,000,000", sub: "file log", values: [0.74, 1.44, 1.3] },+ ],+ table: "vlistGpui",+ source: "bindings/rust/blenderui-vlist-gpui/bench/results.md",+ },+ "vlist-memory": {+ kind: "groups",+ title: "Variable-height list: memory above an empty window",+ subtitle: "Real gpui window, resident memory after the list is built and scrolled",+ unit: "MB",+ better: "lower",+ headline: { value: "6 MB", text: "for 10 million messages (gpui list: 910 MB)" },+ series: [{ name: "blenderui-vlist", ours: true }, { name: "gpui list" }, { name: "gpui-component virtual_list" }],+ groups: [+ { label: "100", values: [0, 0, 0] },+ { label: "1,000,000", values: [2, 86, 10] },+ { label: "10,000,000", sub: "file log", values: [6, 910, 151] },+ ],+ table: "vlistGpui",+ source: "bindings/rust/blenderui-vlist-gpui/bench/results.md",+ },+ "vlist-setup": {+ kind: "groups",+ title: "Variable-height list: setup time",+ subtitle: "From handing the list its messages to being ready to draw, real gpui, median of 3 runs",+ unit: "ms",+ better: "lower",+ headline: { value: "7.3 s to 82 ms", text: "building the 10M list (virtual_list vs ours)" },+ series: [{ name: "blenderui-vlist", ours: true }, { name: "gpui list" }, { name: "gpui-component virtual_list" }],+ groups: [+ { label: "100", values: [0, 0, 0.1] },+ { label: "1,000,000", values: [0.3, 58, 628] },+ { label: "10,000,000", sub: "file log", values: [82, 537, 7285] },+ ],+ table: "vlistGpui",+ source: "bindings/rust/blenderui-vlist-gpui/bench/results.md",+ },+ "vlist-index": {+ kind: "groups",+ title: "Changing one item's height",+ subtitle: "The height index against a flat Vec of running totals, release build, median of 5",+ unit: "ns",+ better: "lower",+ headline: { value: "20,000x", text: "cheaper than a flat array at 10M items" },+ series: [{ name: "HeightIndex", ours: true }, { name: "Flat Vec" }],+ groups: [+ { label: "10,000", values: [53, 684] },+ { label: "1,000,000", values: [112, 81849] },+ { label: "10,000,000", values: [182, 3825956] },+ ],+ table: "vlistIndex",+ source: "bindings/rust/blenderui-vlist/examples/bench_core.rs",+ },+} satisfies Record<string, ChartSpec>-export type ChartId = keyof typeof charts;+export type ChartId = keyof typeof charts/*** The landing page's headline comparison: blenderui against gpui and gpui-fast.@@ -486,12 +738,12 @@ export const highlights = [chart: "idle-cpu",},] as const satisfies readonly {- value: string;- unit: string;- label: string;- note: string;- ours: number;- theirs: { name: string; value: number; display: string };- claim: string;- chart: ChartId;-}[];+ value: string+ unit: string+ label: string+ note: string+ ours: number+ theirs: { name: string; value: number; display: string }+ claim: string+ chart: ChartId+}[]