rat_widget/
lib.rs

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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
//! Current status: BETA
//!
#![doc = include_str!("../readme.md")]
//
#![allow(clippy::collapsible_else_if)]
#![allow(clippy::collapsible_if)]
#![allow(clippy::if_same_then_else)]
#![allow(clippy::clone_on_copy)]
#![allow(clippy::assigning_clones)]

pub mod event {
    //!
    //! Event-handler traits and Keybindings.
    //!

    pub use rat_event::*;

    pub use crate::calendar::event::CalOutcome;
    pub use crate::file_dialog::event::FileOutcome;
    pub use crate::tabbed::event::TabbedOutcome;
    pub use rat_ftable::event::{DoubleClickOutcome, EditOutcome};
    pub use rat_menu::event::MenuOutcome;
    pub use rat_scrolled::event::ScrollOutcome;
    pub use rat_text::event::{ReadOnly, TextOutcome};
}

/// Module for focus-handling functionality.
/// For details see [rat-focus](https://docs.rs/rat-focus)
pub mod focus {
    pub use rat_focus::{
        handle_focus, match_focus, on_gained, on_lost, ContainerFlag, Focus, FocusBuilder,
        FocusFlag, HasFocus, HasFocusFlag, Navigation, ZRect,
    };
}

/// Some functions that calculate more complicate layouts.
pub mod layout {
    mod layout_dialog;
    mod layout_edit;
    mod layout_grid;

    pub use layout_dialog::{layout_dialog, LayoutDialog};
    pub use layout_edit::{layout_edit, EditConstraint, LayoutEdit, LayoutEditIterator};
    pub use layout_grid::{layout_grid, layout_middle};
}

/// Scroll attribute and event-handling.
pub mod scrolled {
    pub use rat_scrolled::{
        Scroll, ScrollArea, ScrollAreaState, ScrollState, ScrollStyle, ScrollSymbols,
        ScrollbarPolicy, SCROLLBAR_DOUBLE_HORIZONTAL, SCROLLBAR_DOUBLE_VERTICAL,
        SCROLLBAR_HORIZONTAL, SCROLLBAR_VERTICAL,
    };
}

/// Text editing core functionality and utilities.
pub mod text {
    pub use rat_text::clipboard;
    pub use rat_text::core;
    pub use rat_text::undo_buffer;
    pub use rat_text::{
        ipos_type, upos_type, Cursor, Glyph, Grapheme, HasScreenCursor, Locale, TextError,
        TextPosition, TextRange,
    };
}

pub mod util;

// --- widget modules here --- (alphabetical)

pub mod button;
pub mod calendar;
/// Number input with patterns from chrono.
///
/// * Undo/redo
/// * Clipboard trait to link to some clipboard implementation.
pub mod date_input {
    pub use rat_text::date_input::{
        handle_events, handle_mouse_events, handle_readonly_events, DateInput, DateInputState,
    };
}
pub mod file_dialog;
pub mod list;
/// Line numbers widget.
/// For use with TextArea mostly.
pub mod line_number {
    pub use rat_text::line_number::{LineNumberState, LineNumberStyle, LineNumbers};
}
/// Menu widgets.
pub mod menu {
    pub use rat_menu::menubar::{MenuBarState, Menubar, MenubarLine, MenubarPopup};
    pub use rat_menu::menuitem::{MenuItem, Separator};
    pub use rat_menu::menuline::{MenuLine, MenuLineState};
    pub use rat_menu::popup_menu::{Placement, PopupMenu, PopupMenuState};
    pub use rat_menu::{MenuBuilder, MenuStructure, MenuStyle, StaticMenu};

    pub mod menubar {
        pub use rat_menu::menubar::{handle_events, handle_mouse_events, handle_popup_events};
    }
    pub mod menuline {
        pub use rat_menu::menuline::{handle_events, handle_mouse_events};
    }
    pub mod popup_menu {
        pub use rat_menu::popup_menu::{handle_mouse_events, handle_popup_events};
    }
}
pub mod msgdialog;
/// Number input with pattern.
///
/// * Undo/redo
/// * Clipboard trait to link to some clipboard implementation.
pub mod number_input {
    pub use rat_text::number_input::{
        handle_events, handle_mouse_events, handle_readonly_events, NumberInput, NumberInputState,
    };
}
pub mod paragraph;
pub mod splitter;
pub mod statusline;
/// Table widget.
///
/// Can be used as a drop-in replacement for the ratatui table. But
/// that's not the point of this widget.
///
/// This widget uses the [TableData](crate::table::TableData) trait instead
/// of rendering all the table-cells and putting them into a Vec.
/// This way rendering time only depends on the screen-size not on
/// the size of your data.
///
/// There is a second trait [TableDataIter](crate::table::TableDataIter) that
/// works better if you only have an Iterator over your data.
pub mod table {
    pub use rat_ftable::{
        edit, selection, textdata, Table, TableContext, TableData, TableDataIter, TableSelection,
        TableState, TableStyle,
    };
}
pub mod tabbed;
/// Text-Input widget
///
/// * Undo/redo
/// * Sync another widget
/// * Support double-width characters
/// * Range based text styling
/// * Clipboard trait to link to some clipboard implementation.
pub mod text_input {
    pub use rat_text::text_input::{
        handle_events, handle_mouse_events, handle_readonly_events, TextInput, TextInputState,
        TextInputStyle,
    };
}
/// Text-Input with pattern/mask.
///
/// * Undo/redo
/// * Sync another widget
/// * Support double-width characters
/// * Range based text styling
/// * Clipboard trait to link to some clipboard implementation.
pub mod text_input_mask {
    pub use rat_text::text_input_mask::{
        handle_events, handle_mouse_events, handle_readonly_events, MaskedInput, MaskedInputState,
    };
}
/// Text-Area.
///
/// * Undo/redo
/// * Sync another widget
/// * Support double-width characters
/// * Range based text styling
/// * Clipboard trait to link to some clipboard implementation.
pub mod textarea {
    pub use rat_text::text_area::{
        handle_events, handle_mouse_events, handle_readonly_events, TextArea, TextAreaState,
        TextAreaStyle,
    };
}
pub mod view;
pub mod viewport;

mod _private {
    #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct NonExhaustive;
}