libnotcurses_sys/widgets/reel/mod.rs
1//! `NcReel` widget.
2
3use crate::c_api::ffi;
4
5/// A wheel with [`NcTablet`]s on the outside.
6///
7/// An `NcReel` is projected onto the 2d rendering area, showing some portion of
8/// the `NcReel`, and zero or more `NcTablet`s.
9///
10/// An `NcReel` is a [`Nc`][crate::Nc] region devoted to displaying zero or more
11/// line-oriented, contained [`NcTablet`]s between which the user may navigate.
12///
13/// If at least one `NcTablet`s exists, there is a "focused tablet".
14/// As much of the focused tablet as is possible is always displayed.
15///
16/// If there is space left over, other tablets are included in the display.
17/// Tablets can come and go at any time, and can grow or shrink at any time.
18pub type NcReel = ffi::ncreel;
19
20/// Options struct for [`NcReel`]
21pub type NcReelOptions = ffi::ncreel_options;
22
23/// Visual tablet for [`NcReel`]
24pub type NcTablet = ffi::nctablet;
25
26impl NcReelOptions {
27 /// is navigation circular (does moving down from the last tablet move to the
28 /// first, and vice versa)? only meaningful when infinitescroll is true. if
29 /// infinitescroll is false, this must be false.
30 pub const CIRCULAR: u32 = c_api::NCREEL_OPTION_CIRCULAR;
31 /// is scrolling infinite (can one move down or up forever, or is an end
32 /// reached?). if true, 'circular' specifies how to handle the special case of
33 /// an incompletely-filled reel.
34 pub const INFINITESCROLL: u32 = c_api::NCREEL_OPTION_INFINITESCROLL;
35}
36
37pub(crate) mod c_api {
38 use super::ffi;
39
40 /// is navigation circular (does moving down from the last tablet move to the
41 /// first, and vice versa)? only meaningful when infinitescroll is true. if
42 /// infinitescroll is false, this must be false.
43 pub const NCREEL_OPTION_CIRCULAR: u32 = ffi::NCREEL_OPTION_CIRCULAR;
44 /// is scrolling infinite (can one move down or up forever, or is an end
45 /// reached?). if true, 'circular' specifies how to handle the special case of
46 /// an incompletely-filled reel.
47 pub const NCREEL_OPTION_INFINITESCROLL: u32 = ffi::NCREEL_OPTION_INFINITESCROLL;
48}