notcurses/
lib.rs

1// notcurses::lib
2//
3//! A rusty notcurses wrapper.
4//!
5//!
6//! ### Example
7#![doc = concat!["```\n", include_str!("../examples/hello-world.rs"), "\n```" ]]
8//!
9//
10
11#![warn(clippy::all)]
12#![allow(clippy::module_inception, non_upper_case_globals)]
13
14use core::cell::RefCell;
15use once_cell::sync::OnceCell;
16
17mod color;
18mod error;
19mod input;
20mod macros;
21mod notcurses;
22mod plane;
23mod visual;
24
25pub use self::notcurses::{Capabilities, LogLevel, Notcurses, NotcursesBuilder, Statistics};
26pub use color::{Alpha, Channel, Channels, Palette, Rgb, Rgba};
27pub use error::{NotcursesError, NotcursesResult};
28pub use input::{Input, InputType, Key, KeyMod, MiceEvents, Received};
29pub use plane::{Align, Cell, Plane, PlaneBuilder, PlaneGeometry, Style};
30pub use visual::{
31    Blitter, PixelImplementation, Scale, Visual, VisualBuilder, VisualGeometry, VisualOptions,
32};
33
34//
35
36thread_local!(
37    /// Restricts initializing more than one `Notcurses` instance per thread, at the same time.
38    static NOTCURSES_LOCK: RefCell<OnceCell<bool>> = RefCell::new(OnceCell::new());
39
40    /// Restricts instancing the standard `Plane` more than once per `Notcurses` instance.
41    static CLI_PLANE_LOCK: RefCell<OnceCell<bool>> = RefCell::new(OnceCell::new());
42);
43
44/// Reexport of [`libnotcurses-sys`](https://docs.rs/libnotcurses-sys).
45///
46/// ---
47#[doc(inline)]
48pub use libnotcurses_sys as sys;
49
50pub(crate) use sys::from_primitive;
51pub(crate) use sys::unit_impl_fmt;
52pub(crate) use sys::unit_impl_ops;
53
54#[doc(inline)]
55pub use cuadra::{Position32 as Position, Size32 as Size};