ncursesw/lib.rs
1/*
2 src/lib.rs
3
4 Copyright (c) 2019, 2020 Stephen Whittle All rights reserved.
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom
11 the Software is furnished to do so, subject to the following conditions:
12 The above copyright notice and this permission notice shall be included
13 in all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 IN THE SOFTWARE.
21*/
22
23#![allow(non_camel_case_types)]
24
25extern crate libc;
26extern crate ascii;
27extern crate semver;
28extern crate errno;
29#[macro_use]
30extern crate lazy_static;
31
32mod macros;
33
34/// Extended color's, color pairs and attributes module
35pub mod extend;
36/// Compiled in `ncursesw` features
37pub mod features;
38/// NCurses Form module
39///
40/// The form library provides terminal-independent facilities for composing
41/// form screens on character-cell terminals. The library includes: field
42/// routines, which create and modify form fields; and form routines, which
43/// group fields into forms, display forms on the screen, and handle
44/// interaction with the user.
45///
46/// Your program should set up the locale, e.g.,
47/// ```text
48/// use gettextrs;
49///
50/// ncursesw::setlocale(LcCategory::All, "")?;
51/// ```
52/// so that input/output processing will work.
53pub mod form;
54/// Traits used by `ncursesw`
55mod gen;
56/// Normal color's, color pairs and attributes module
57pub mod normal;
58/// NCurses Menu module
59///
60/// The menu library provides terminal-independent facilities for composing
61/// menu systems on character-cell terminals. The library includes: item routines,
62/// which create and modify menu items; and menu routines, which group items into
63/// menus, display menus on the screen, and handle interaction with the user.
64pub mod menu;
65/// NCurses Mouse module
66///
67/// These functions provide an interface to mouse events from NCurses. Mouse events
68/// are represented by `KeyBinding::KeyMouse` pseudo-key values in the `wgetch()`
69/// input stream.
70pub mod mouse;
71/// NCurses Panels module
72///
73/// Panels are NCurses windows with the added feature of depth. Panel functions allow
74/// the use of stacked windows and ensure the proper portions of each window and the
75/// NCurses `stdscr()` window are hidden or displayed when panels are added, moved,
76/// modified or removed. The set of currently visible panels is the stack of panels.
77/// The `stdscr()` window is beneath all panels, and is not considered part of the stack.
78///
79/// A window is associated with every panel. The panel routines enable you to create,
80/// move, hide, and show panels, as well as position a panel at any desired location
81/// in the stack.
82///
83/// Panel routines are a functional layer added to NCurses, make only high-level
84/// NCurses calls, and work anywhere terminfo NCurses does.
85pub mod panels;
86/// NCurses API shims module
87pub mod shims;
88
89mod chtypet;
90mod complex;
91mod wide;
92
93mod attributescolorpairset;
94mod characterresult;
95mod cstring;
96mod changed;
97mod cursortype;
98mod funcs;
99mod justification;
100mod keybinding;
101mod legacy;
102mod ncurses;
103mod ncursescolortype;
104mod ncurseswerror;
105mod orientation;
106mod origin;
107mod region;
108mod size;
109mod softlabeltype;
110
111pub use crate::{
112 chtypet::*, complex::*, wide::*,
113
114 attributescolorpairset::*, characterresult::*, changed::*, cursortype::*,
115 funcs::*, gen::*, justification::*, keybinding::*, legacy::*, ncurses::*,
116 ncursescolortype::*, ncurseswerror::*, origin::*, orientation::*, region::*,
117 size::*, softlabeltype::*
118};
119use crate::shims::*;
120
121/// NCurses window raw pointer.
122pub type WINDOW = shims::ncurses::WINDOW;
123/// NCurses screen raw pointer.
124pub type SCREEN = shims::ncurses::SCREEN;
125/// Ripoff line callback function signature.
126pub type RipoffInit = shims::bindings::RipoffInit;
127/// Raw attribute type value.
128pub type attr_t = shims::ncurses::attr_t;