https://github.com/maratik123/quartzite
GUI and object framework for Rust: signals/slots, properties, reflective object model
https://github.com/maratik123/quartzite
gui gui-framework no-std object-model proc-macros reflection rust signals-slots
Last synced: 3 days ago
JSON representation
GUI and object framework for Rust: signals/slots, properties, reflective object model
- Host: GitHub
- URL: https://github.com/maratik123/quartzite
- Owner: maratik123
- License: apache-2.0
- Created: 2026-05-01T19:01:35.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2026-05-30T10:31:34.000Z (5 days ago)
- Last Synced: 2026-05-30T12:12:09.749Z (5 days ago)
- Topics: gui, gui-framework, no-std, object-model, proc-macros, reflection, rust, signals-slots
- Language: Rust
- Homepage: https://maratik123.github.io/quartzite/
- Size: 6.06 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 112
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-APACHE
- Roadmap: ROADMAP.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# quartzite
[](https://github.com/maratik123/quartzite/actions/workflows/ci.yml)
[](https://maratik123.github.io/quartzite/)
[](https://codecov.io/gh/maratik123/quartzite)
[](#license)
A GUI and object framework for Rust drawing on Qt's signals/slots and
property/reflection model — implemented in idiomatic Rust with no native
dependencies, no foreign ABI, and no codegen outside proc-macros.
## Current scope
- **Object model:** `ObjectBase`, parent/child trees, named lookup, reflection metadata.
- **Signals/slots:** typed `Signal`, dynamic dispatch via `Object::invoke_method`, cross-thread queued connections.
- **Event loop:** `Application` singleton (builder via `ApplicationBuilder`; Object-ified with `quit` slot), per-thread `EventLoop` (Object-ified; tickless by default, configurable `Option` tick), queued dispatcher.
- **Timers:** `Timer` object with `AppDriver` / `PoolDriver` / `ThreadDriver` execution contexts.
- **Painting API** (`quartzite-paint-api`) — 11-method `Painter` trait (rect/line/text/image/path/transform/state), `Color`, `Pen`, `Brush`/`BrushKind` (solid + 2-stop linear/radial gradient + `Custom(peniko::Gradient)` escape hatch), `Font`, `Image`, `Path` — `no_std`-compatible.
- **Renderer** (`quartzite-renderer`) — `WindowedApplication` (multi-window, configurable last-window-quit policy, proxy-based `AppEvent::Exit`) + `WindowRegistry` (per-window event fan-out via `WindowedAppHandler`) + `VelloPainter` (full 11-method `Painter` impl — rect/line/path/image/text via parley+skrifa; transform/clip stack; vello + wgpu + winit) + `RenderHarness` / `RenderHarnessBuilder` offscreen test harness for snapshot testing.
- **Widgets** (`quartzite-widgets`) — `WidgetBase`, `WidgetExt`, layouts (`BoxLayout`, `GridLayout`), and built-in widgets (`Label`, `Button`, `LineEdit`, `TextEdit`, `ScrollArea`, `Container`).
- **Snapshot / save-restore** (`serde` feature) — `capture_object` / `restore_object` / `capture_tree` / `restore_tree` with JSON and bincode support; `Value::Custom` round-trips via `typetag`.
## Forward scope
- **Style system** (`quartzite-style`) — declarative styling on top of widgets.
## Non-goals
- Not a Qt port or a Qt binding — Qt is design lineage, not API surface.
- No FFI / native dependencies — pure-Rust toolchain.
## Status
Early development. Core crates and the widget system are implemented; full painting and theming layers are next.
| Crate | Status |
|---|---|
| `quartzite` (facade) | ✅ implemented |
| `quartzite-core` | ✅ implemented |
| `quartzite-macros` | ✅ implemented |
| `quartzite-runtime` | ✅ implemented (tickless `EventLoop` + `ApplicationBuilder` + Object-ification of `EventLoop`/`Application` with `stop`/`quit` slots #561) |
| `examples/` | ✅ runnable examples: `hello_object`, `signals_slots`, `object_tree`, `timer` |
| `quartzite-geometry` / `quartzite-events` / `quartzite-event-types` | ✅ implemented |
| `quartzite-paint-api` | ✅ implemented (Color, Pen, Brush/BrushKind incl. LinearGradient/RadialGradient/Custom gradient, Font, Image, Path, 13-method Painter trait; TextCaretCursor/TextVisualLineCursor/TextVisualLine cursor types #317; `draw_text_in` `h_align + v_align: Alignment` two-axis extension #555) |
| `quartzite-paint` | ✅ implemented (re-export shell over paint-api + Alignment from geometry + peniko gradient re-exports) |
| `quartzite-paint-util` | ✅ implemented (#410, `TranslateGuard` RAII wrapper for `save`/`translate`/`restore` triplet; `no_std` + panic-safe) |
| `quartzite-renderer` | ✅ implemented (WindowedApplication + multi-window WindowRegistry + WindowedAppHandler + VelloPainter full 11-method impl with parley/skrifa text; RenderHarness/RenderHarnessBuilder snapshot harness) |
| `quartzite-widgets` | ✅ implemented (#46) |
| `quartzite-style-types` | ✅ implemented (#47, leaf: Palette, ColorRole; #488 DARK_PALETTE; #402 ColorGroup axis + FocusRing) |
| `quartzite-style` | ✅ implemented (#47, downstream: Style trait, StyleRegistry; #290 DefaultStyle concrete impl; #297 GPU snapshot tests; #318 Container+LineEdit arms; #458 read-only overlay fix; #402 ColorGroup palette migration; #317 StyleClock + caret/selection rendering for TextEdit; #555 design-system conformance audit + Button/Label vertical centring) |
| `quartzite-style-dispatch` | ✅ implemented (#312, widget-tree paint dispatcher: `dispatch_paint` + `WidgetResolver`; #393 facade `style-dispatch` feature; #395 `WidgetResolver` moved to `quartzite-hit-test`, re-exported here) |
| `quartzite-hit-test` | ✅ implemented (#395, paint-free reverse-z-order `hit_test(root, point, resolver) -> Option<(ObjectId, Point)>`; owns the immutable `WidgetResolver` trait) |
## Usage
Add `quartzite` to your `Cargo.toml` — no sub-crate deps required:
```toml
[dependencies]
quartzite = { git = "https://github.com/maratik123/quartzite" }
```
Import the prelude for typical usage, or use explicit module paths:
```rust
// one glob covers the object model, signals, derive macros, and runtime
use quartzite::prelude::*;
// explicit paths when you want legibility
use quartzite::core::ObjectBase;
use quartzite::macros::MetaEnum; // requires `derive` feature (on by default)
use quartzite::runtime::Application;
```
Disable the `derive` feature to skip proc-macro compilation:
```toml
quartzite = { git = "...", default-features = false, features = ["std"] }
```
## Prerequisites
- Rust stable (≥ 1.96)
- Cargo (comes with Rust)
## Build
```bash
cargo build --workspace
```
## Test
```bash
cargo test --workspace
```
## Lint
```bash
cargo clippy --workspace --all-targets -- -D warnings
```
## Format
```bash
cargo fmt --all # apply
cargo fmt --all -- --check # verify (CI gate)
```
## Docs
```bash
RUSTDOCFLAGS="-D warnings -D missing-docs" cargo doc --no-deps --workspace
```
## License
Dual-licensed under either of:
- [MIT License](LICENSE-MIT) ([https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT))
- [Apache License, Version 2.0](LICENSE-APACHE) ([https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0))
at your option. This is the standard Rust ecosystem dual-license.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.