curses_sys/
extensions.rs

1use libc::{c_void, c_char, c_int};
2use base::{WINDOW, SCREEN};
3
4pub type WINDOW_CB = extern "C" fn(*mut WINDOW, *mut c_void) -> c_int;
5pub type SCREEN_CB = extern "C" fn(*mut SCREEN, *mut c_void) -> c_int;
6
7#[cfg_attr(feature = "wide", link(name = "ncursesw"))]
8#[cfg_attr(not(feature = "wide"), link(name = "ncurses"))]
9extern "C" {
10	pub fn is_cleared(win: *const WINDOW) -> bool;
11	pub fn is_idcok(win: *const WINDOW) -> bool;
12	pub fn is_idlok(win: *const WINDOW) -> bool;
13	pub fn is_immedok(win: *const WINDOW) -> bool;
14	pub fn is_keypad(win: *const WINDOW) -> bool;
15	pub fn is_leaveok(win: *const WINDOW) -> bool;
16	pub fn is_nodelay(win: *const WINDOW) -> bool;
17	pub fn is_notimeout(win: *const WINDOW) -> bool;
18	pub fn is_pad(win: *const WINDOW) -> bool;
19	pub fn is_scrollok(win: *const WINDOW) -> bool;
20	pub fn is_subwin(win: *const WINDOW) -> bool;
21	pub fn is_syncok(win: *const WINDOW) -> bool;
22	pub fn wgetparent(win: *const WINDOW) -> *mut WINDOW;
23	pub fn wgetdelay(win: *const WINDOW) -> c_int;
24	pub fn wgetscrreg(win: *const WINDOW, top: *mut c_int, bottom: *mut c_int) -> c_int;
25
26	pub fn is_term_resized(lines: c_int, columns: c_int) -> bool;
27	pub fn resize_term(lines: c_int, columns: c_int) -> bool;
28	pub fn resizeterm(lines: c_int, columns: c_int) -> c_int;
29
30	pub fn getattrs(win: *const WINDOW) -> c_int;
31	pub fn getbegx(win: *const WINDOW) -> c_int;
32	pub fn getbegy(win: *const WINDOW) -> c_int;
33	pub fn getcurx(win: *const WINDOW) -> c_int;
34	pub fn getcury(win: *const WINDOW) -> c_int;
35	pub fn getmaxx(win: *const WINDOW) -> c_int;
36	pub fn getmaxy(win: *const WINDOW) -> c_int;
37	pub fn getparx(win: *const WINDOW) -> c_int;
38	pub fn getpary(win: *const WINDOW) -> c_int;
39
40	pub fn use_default_colors() -> c_int;
41	pub fn assume_default_colors(fg: c_int, bg: c_int) -> c_int;
42
43	pub fn get_escdelay() -> c_int;
44	pub fn set_escdelay(size: c_int) -> c_int;
45	pub fn set_tabsize(size: c_int) -> c_int;
46	pub fn use_screen(scr: *mut SCREEN, cb: SCREEN_CB, data: *mut c_void) -> c_int;
47	pub fn use_window(win: *mut WINDOW, cb: WINDOW_CB, data: *mut c_void) -> c_int;
48
49	pub fn use_legacy_coding(level: c_int) -> c_int;
50
51	pub fn wresize(win: *mut WINDOW, lines: c_int, columns: c_int) -> c_int;
52
53	pub fn define_key(definition: *const c_char, keycode: c_int) -> c_int;
54	pub fn keybound(keycode: c_int, count: c_int) -> *const c_char;
55	pub fn key_deifned(definition: *const c_char) -> c_int;
56
57	pub fn curses_version() -> *const c_char;
58	pub fn use_extended_names(enable: bool) -> c_int;
59}