Expand description
Horizon Lattice - A Rust-native GUI framework inspired by Qt6.
This is the main umbrella crate that re-exports all public APIs.
§Example
use horizon_lattice::Application;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let app = Application::new()?;
// Create windows and widgets here...
Ok(app.run()?)
}§Widgets
The widget system provides the foundation for building user interfaces:
ⓘ
use horizon_lattice::widget::{Widget, WidgetBase, SizeHint, PaintContext};
struct MyWidget {
base: WidgetBase,
}
impl Widget for MyWidget {
fn widget_base(&self) -> &WidgetBase { &self.base }
fn widget_base_mut(&mut self) -> &mut WidgetBase { &mut self.base }
fn size_hint(&self) -> SizeHint {
SizeHint::from_dimensions(100.0, 100.0)
}
fn paint(&self, ctx: &mut PaintContext<'_>) {
// Draw the widget...
}
}Modules§
- file
- File I/O operations and utilities. File I/O operations and utilities.
- invocation
- Queued invocation registry for cross-thread signal delivery.
- logging
- Logging and debugging facilities for Horizon Lattice.
- meta
- Meta-object system for Horizon Lattice.
- model
- Model/View architecture module. Model/View architecture for Horizon Lattice.
- object
- Object model for Horizon Lattice.
- platform
- Platform services and system integration. Platform services and system integration.
- prelude
- Prelude module for convenient imports.
- progress
- Progress reporting for background tasks.
- property
- Property system for Horizon Lattice.
- render
- Graphics rendering module.
- signal
- Signal/slot system for Horizon Lattice.
- thread_
check - Thread safety verification utilities for Horizon Lattice.
- threadpool
- Thread pool for background task execution.
- widget
- Widget system module. Widget system for Horizon Lattice.
- window
- Native window management module. Native window management module.
- worker
- Worker pattern for dedicated background thread processing.
Macros§
- assert_
main_ thread - Panics if the current thread is not the main thread.
- debug_
assert_ main_ thread - Debug-only assertion that panics if not on the main thread.
- lattice_
debug - Log a debug-level message to the Horizon Lattice target.
- lattice_
error - Log an error-level message to the Horizon Lattice target.
- lattice_
info - Log an info-level message to the Horizon Lattice target.
- lattice_
trace - Macros for common tracing patterns.
- lattice_
warn - Log a warning-level message to the Horizon Lattice target.
Structs§
- Active
Event Loop - Target that associates windows with an
EventLoop. - Aggregate
Progress - Aggregates progress from multiple weighted sub-tasks.
- Application
- The main application event loop and coordinator.
- Binding
- A computed property that derives its value from a computation.
- Connection
Guard - A connection guard that automatically disconnects when dropped.
- Connection
Id - A unique identifier for a signal-slot connection.
- Meta
Object - Static metadata for an
Objecttype. - Meta
Property - Metadata for a property with type-erased accessors.
- Method
Meta - Metadata for a callable method.
- Modifiers
- Describes keyboard modifiers event.
- Object
Base - Helper for implementing the
Objecttrait. - Object
Id - A unique identifier for an object in the registry.
- Object
Registry - The central registry that manages all objects and their relationships.
- Object
Tree Debug - Debug utility for visualizing object trees.
- Perf
Span - A guard that emits a tracing span when dropped.
- Progress
Reporter - A thread-safe progress reporter for background tasks.
- Progress
Update - A progress update containing both progress value and optional message.
- Property
- A reactive property that tracks changes.
- Property
Meta - Metadata for a property, used for runtime introspection.
- Read
Only Property - A read-only view of a property.
- Scheduled
Task Id - A unique identifier for a scheduled task.
- Shared
Object Registry - A thread-safe wrapper around
ObjectRegistry. - Signal
- A type-safe signal that can have multiple connected slots.
- Signal
Meta - Metadata for a signal.
- TaskId
- A unique identifier for a deferred task.
- Thread
Affinity - Thread affinity tracker for objects.
- TimerId
- A unique identifier for a timer.
- Tree
Format Options - Configuration for object tree debug output.
- Type
Registry - Global registry of all
Objecttypes. - Widget
State - Widget-specific state stored in the registry for state propagation.
- Window
- Represents a window.
- Window
Attributes - Attributes used when creating a window.
- Window
Id - Identifier of a window. Unique for each window.
- Worker
- A dedicated worker thread with its own task queue.
- Worker
Builder - Builder for creating Workers with custom configuration.
- Worker
Config - Configuration for creating a Worker.
Enums§
- Connection
Type - Specifies how a connected slot should be invoked when the signal is emitted.
- Event
Priority - Priority levels for internal events. Higher priority events are processed first within the same event loop iteration.
- Lattice
Error - The main error type for Horizon Lattice operations.
- Lattice
Event - Internal events dispatched through the Horizon Lattice event loop.
- Meta
Error - Error types for meta-object operations.
- Object
Error - Errors that can occur during object operations.
- Property
Error - Error types for property operations.
- Scheduled
Task Kind - The type of scheduled task.
- Scheduler
Error - Scheduler-specific errors.
- Signal
Error - Signal-specific errors.
- Thread
Error - Thread safety-specific errors.
- Thread
Pool Error - Thread pool-specific errors.
- Timer
Error - Timer-specific errors.
- Tree
Style - Style options for object tree visualization.
Traits§
- Into
Property - A helper trait for creating properties with common patterns.
- Object
- The base trait that all objects must implement.
- Signal
Emitter - Type-erased signal emitter trait for dynamic signal access.
Functions§
- are_
thread_ checks_ enabled - Check if runtime thread checks are currently enabled.
- global_
registry - Get a reference to the global object registry.
- init_
global_ registry - Initialize the global object registry.
- init_
type_ registry - Initialize the global type registry.
- is_
main_ thread - Check if the current thread is the main (UI) thread.
- main_
thread_ id - Get the main thread ID if it has been set.
- object_
cast - Safe downcast function for
Objecttrait objects. - object_
cast_ mut - Safe mutable downcast function for
Objecttrait objects. - set_
thread_ checks_ enabled - Enable or disable runtime thread checks.
Type Aliases§
- Meta
Result - Result type for meta-object operations.
- Object
Result - Result type for object operations.
- Result
- A specialized Result type for Horizon Lattice operations.
- Window
Event Handler - The main application struct, managing the event loop and global state.
Derive Macros§
- Object
- Derive the
Objecttrait and generate meta-object information.