Skip to main content

Crate horizon_lattice

Crate horizon_lattice 

Source
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§

ActiveEventLoop
Target that associates windows with an EventLoop.
AggregateProgress
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.
ConnectionGuard
A connection guard that automatically disconnects when dropped.
ConnectionId
A unique identifier for a signal-slot connection.
MetaObject
Static metadata for an Object type.
MetaProperty
Metadata for a property with type-erased accessors.
MethodMeta
Metadata for a callable method.
Modifiers
Describes keyboard modifiers event.
ObjectBase
Helper for implementing the Object trait.
ObjectId
A unique identifier for an object in the registry.
ObjectRegistry
The central registry that manages all objects and their relationships.
ObjectTreeDebug
Debug utility for visualizing object trees.
PerfSpan
A guard that emits a tracing span when dropped.
ProgressReporter
A thread-safe progress reporter for background tasks.
ProgressUpdate
A progress update containing both progress value and optional message.
Property
A reactive property that tracks changes.
PropertyMeta
Metadata for a property, used for runtime introspection.
ReadOnlyProperty
A read-only view of a property.
ScheduledTaskId
A unique identifier for a scheduled task.
SharedObjectRegistry
A thread-safe wrapper around ObjectRegistry.
Signal
A type-safe signal that can have multiple connected slots.
SignalMeta
Metadata for a signal.
TaskId
A unique identifier for a deferred task.
ThreadAffinity
Thread affinity tracker for objects.
TimerId
A unique identifier for a timer.
TreeFormatOptions
Configuration for object tree debug output.
TypeRegistry
Global registry of all Object types.
WidgetState
Widget-specific state stored in the registry for state propagation.
Window
Represents a window.
WindowAttributes
Attributes used when creating a window.
WindowId
Identifier of a window. Unique for each window.
Worker
A dedicated worker thread with its own task queue.
WorkerBuilder
Builder for creating Workers with custom configuration.
WorkerConfig
Configuration for creating a Worker.

Enums§

ConnectionType
Specifies how a connected slot should be invoked when the signal is emitted.
EventPriority
Priority levels for internal events. Higher priority events are processed first within the same event loop iteration.
LatticeError
The main error type for Horizon Lattice operations.
LatticeEvent
Internal events dispatched through the Horizon Lattice event loop.
MetaError
Error types for meta-object operations.
ObjectError
Errors that can occur during object operations.
PropertyError
Error types for property operations.
ScheduledTaskKind
The type of scheduled task.
SchedulerError
Scheduler-specific errors.
SignalError
Signal-specific errors.
ThreadError
Thread safety-specific errors.
ThreadPoolError
Thread pool-specific errors.
TimerError
Timer-specific errors.
TreeStyle
Style options for object tree visualization.

Traits§

IntoProperty
A helper trait for creating properties with common patterns.
Object
The base trait that all objects must implement.
SignalEmitter
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 Object trait objects.
object_cast_mut
Safe mutable downcast function for Object trait objects.
set_thread_checks_enabled
Enable or disable runtime thread checks.

Type Aliases§

MetaResult
Result type for meta-object operations.
ObjectResult
Result type for object operations.
Result
A specialized Result type for Horizon Lattice operations.
WindowEventHandler
The main application struct, managing the event loop and global state.

Derive Macros§

Object
Derive the Object trait and generate meta-object information.