ncurseswwin/lib.rs
1/*
2 src/lib.rs
3
4 Copyright (c) 2019-2021 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
23extern crate libc;
24extern crate ncursesw;
25#[macro_use]
26extern crate lazy_static;
27extern crate strum;
28extern crate strum_macros;
29extern crate errno;
30
31mod macros;
32
33mod cstring;
34/// Extended color's, color pairs and attributes module.
35pub mod extend;
36/// Form module
37///
38/// The form library provides terminal-independent facilities for composing
39/// form screens on character-cell terminals. The library includes: field
40/// routines, which create and modify form fields; and form routines, which
41/// group fields into forms, display forms on the screen, and handle
42/// interaction with the user.
43///
44/// Your program should set up the locale, e.g.,
45/// ```text
46/// use gettextrs;
47///
48/// ncursesw::setlocale(LcCategory::All, "")?;
49/// ```
50/// so that input/output processing will work.
51pub mod form;
52mod funcs;
53mod gen;
54mod graphics;
55mod inputmode;
56/// Menu module
57///
58/// The menu library provides terminal-independent facilities for composing
59/// menu systems on character-cell terminals. The library includes: item routines,
60/// which create and modify menu items; and menu routines, which group items into
61/// menus, display menus on the screen, and handle interaction with the user.
62pub mod menu;
63mod mouse;
64mod ncurses;
65mod ncurseswwinerror;
66mod nonblockingresult;
67/// Normal color's, color pairs and attributes module.
68pub mod normal;
69mod origin;
70mod pad;
71mod panels;
72mod position;
73mod region;
74mod ripoff;
75mod screen;
76mod size;
77mod timeout;
78mod window;
79
80pub use crate::{
81 funcs::*, gen::*, graphics::*, inputmode::*, mouse::*, ncurses::*,
82 ncurseswwinerror::*, nonblockingresult::*, origin::*, pad::*,
83 panels::*, position::*, region::*, ripoff::*, screen::*, size::*,
84 timeout::*, window::*
85};
86
87pub use ncursesw::{
88 ChtypeChar, ChtypeString, ComplexChar, ComplexString,
89 WideChar, WideCharAndAttributes, WideString
90};
91pub use ncursesw::{
92 AttributesColorPairSet, Changed, CharacterResult, CursorType, Justification,
93 KeyBinding, Legacy, NCursesColorType, NCurseswError, panels::NCurseswPanelsError,
94 mouse::NCurseswMouseError, menu::NCurseswMenuError, form::NCurseswFormError,
95 Orientation, SoftLabelType
96};
97pub use ncursesw::{
98 AttributesType, ColorAttributeTypes, ColorPairColors, ColorPairType, ColorType,
99 ColorsType
100};
101pub use ncursesw::{
102 COLORS, COLOR_PAIRS, ESCDELAY, TABSIZE, baudrate, beep,
103 can_change_color, curses_version, def_prog_mode, def_shell_mode,
104 define_key, delay_output, doupdate, flash, get_escdelay, getcchar,
105 halfdelay, has_colors, has_ic, has_il, has_key, is_term_resized,
106 key_defined, key_name, keybound, keyname, keyok, killchar, killwchar,
107 longname, mcprint, ncurses_colortype, ncurses_colortype_set,
108 ncurses_version, reset_prog_mode, reset_shell_mode, resetty,
109 resize_term, resizeterm, savetty, scr_dump, scr_init, scr_restore,
110 scr_set, scrl, set_escdelay, set_tabsize, setcchar, typeahead,
111 use_legacy_coding
112};
113pub use ncursesw::features;
114pub use ncursesw::mouse::{
115 has_mouse, mouseinterval, mouse_version, has_mouse_interface
116};