1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
//! # MinUI - A Minimal Terminal UI Framework
//!
//! MinUI is a lightweight terminal UI framework for building both traditional TUI applications
//! and terminal-based games. It focuses on simplicity and ease of use while providing the
//! essential tools you need to create engaging terminal interfaces.
//!
//! ## What MinUI Offers
//!
//! - Event-driven TUI applications and fixed-rate game loops
//! - Simple widget system with containers, labels, panels, and text blocks
//! - Full color support (RGB, ANSI, named colors)
//! - Cross-platform keyboard and mouse input
//! - Game development tools (sprites, collision detection, maps)
//! - Buffered rendering for smooth updates
//!
//! ## Quick Start
//!
//! ```rust
//! use minui::prelude::*;
//!
//! let mut app = App::new(())?;
//!
//! app.run(
//! |_state, event| {
//! // Return false to exit on 'q' key
//! !matches!(event, Event::Character('q'))
//! },
//! |_state, window| {
//! let label = Label::new("Hello, MinUI!");
//! let _ = label.draw(window);
//! }
//! )?;
//! # Ok::<(), minui::Error>(())
//! ```
//!
//! ## Main Components
//!
//! - [`app`] - Application runner and main loops
//! - [`widgets`] - UI components (labels, panels, containers)
//! - [`color`] - Color handling and styling
//! - [`input`] - Keyboard and mouse input
//! - [`render`] - Low-level rendering and buffers
//! - [`game`] - Game development utilities
//! - [`window`] - Terminal window management
//!
//! Check out the examples in the `examples/` directory to see MinUI in action.
//! Run them with: `cargo run --example basic_usage`
// Core types
pub use App;
pub use ;
pub use ;
pub use ;
pub use ;
// Input handling
pub use KeyboardHandler;
// Widget system
pub use ;
/// Common imports for MinUI applications.
///
/// This module contains the most frequently used types and traits.
/// Import everything with `use minui::prelude::*;` to get started quickly:
///
/// ```rust
/// use minui::prelude::*;
///
/// let label = Label::new("Hello");
/// let color = Color::rgb(255, 0, 0);
/// let app = App::new(my_state)?;
/// # Ok::<(), minui::Error>(())
/// ```