horizon_lattice/lib.rs
1//! Horizon Lattice - A Rust-native GUI framework inspired by Qt6.
2//!
3//! This is the main umbrella crate that re-exports all public APIs.
4
5#![warn(missing_docs)]
6// Framework crate: many public API items are not exercised internally
7#![allow(dead_code)]
8// Allow pre-existing clippy lints - many have complex signatures needed for widget APIs
9#![allow(clippy::too_many_arguments)]
10// Widget APIs often use complex callback types
11#![allow(clippy::type_complexity)]
12// Test code commonly uses this pattern
13#![allow(clippy::field_reassign_with_default)]
14// Common in widget rendering code
15#![allow(clippy::collapsible_if)]
16// Framework methods may shadow std trait names intentionally
17#![allow(clippy::should_implement_trait)]
18// Widget APIs use closures for flexibility
19#![allow(clippy::redundant_closure)]
20// Common pattern for optional constraint handling
21#![allow(clippy::unnecessary_unwrap)]
22// Unit returns are common for init functions
23#![allow(clippy::let_unit_value)]
24// Borrowed expressions often work with generic APIs
25#![allow(clippy::needless_borrows_for_generic_args)]
26// Large enums are acceptable for event/error types
27#![allow(clippy::large_enum_variant)]
28// Some if blocks are intentionally similar for readability
29#![allow(clippy::if_same_then_else)]
30// Module naming follows Qt conventions
31#![allow(clippy::module_inception)]
32// Doc formatting is intentional
33#![allow(clippy::doc_overindented_list_items)]
34// Manual prefix stripping for specific patterns
35#![allow(clippy::manual_strip)]
36// Manual clamp patterns for clarity
37#![allow(clippy::manual_clamp)]
38// File options patterns
39#![allow(clippy::ineffective_open_options)]
40// Loop indexing patterns
41#![allow(clippy::needless_range_loop)]
42//!
43//! # Example
44//!
45//! ```no_run
46//! use horizon_lattice::Application;
47//!
48//! fn main() -> Result<(), Box<dyn std::error::Error>> {
49//! let app = Application::new()?;
50//! // Create windows and widgets here...
51//! Ok(app.run()?)
52//! }
53//! ```
54//!
55//! # Widgets
56//!
57//! The widget system provides the foundation for building user interfaces:
58//!
59//! ```ignore
60//! use horizon_lattice::widget::{Widget, WidgetBase, SizeHint, PaintContext};
61//!
62//! struct MyWidget {
63//! base: WidgetBase,
64//! }
65//!
66//! impl Widget for MyWidget {
67//! fn widget_base(&self) -> &WidgetBase { &self.base }
68//! fn widget_base_mut(&mut self) -> &mut WidgetBase { &mut self.base }
69//!
70//! fn size_hint(&self) -> SizeHint {
71//! SizeHint::from_dimensions(100.0, 100.0)
72//! }
73//!
74//! fn paint(&self, ctx: &mut PaintContext<'_>) {
75//! // Draw the widget...
76//! }
77//! }
78//! ```
79
80pub use horizon_lattice_core::*;
81pub use horizon_lattice_macros::*;
82
83/// Prelude module for convenient imports.
84///
85/// Import everything commonly needed with:
86/// ```ignore
87/// use horizon_lattice::prelude::*;
88/// ```
89pub mod prelude;
90
91/// Graphics rendering module.
92pub mod render {
93 pub use horizon_lattice_render::*;
94}
95
96/// File I/O operations and utilities.
97pub mod file;
98
99/// Platform services and system integration.
100pub mod platform;
101
102/// Widget system module.
103pub mod widget;
104
105/// Model/View architecture module.
106pub mod model;
107
108/// Native window management module.
109pub mod window;
110
111/// Networking module (requires `networking` feature).
112#[cfg(feature = "networking")]
113pub mod net {
114 pub use horizon_lattice_net::*;
115}
116
117/// Multimedia module (requires `multimedia` feature).
118#[cfg(feature = "multimedia")]
119pub mod multimedia {
120 pub use horizon_lattice_multimedia::*;
121}