pub use pancurses::{Attribute, Attributes, ColorPair, Input};
pub use pancurses::{
    ACS_BBSS, ACS_BLOCK, ACS_BOARD, ACS_BSBS, ACS_BSSB, ACS_BSSS, ACS_BTEE, ACS_BULLET,
    ACS_CKBOARD, ACS_DARROW, ACS_DEGREE, ACS_DIAMOND, ACS_GEQUAL, ACS_HLINE, ACS_LANTERN,
    ACS_LARROW, ACS_LEQUAL, ACS_LLCORNER, ACS_LRCORNER, ACS_LTEE, ACS_NEQUAL, ACS_PI, ACS_PLMINUS,
    ACS_PLUS, ACS_RARROW, ACS_RTEE, ACS_S1, ACS_S3, ACS_S7, ACS_S9, ACS_SBBS, ACS_SBSB, ACS_SBSS,
    ACS_SSBB, ACS_SSBS, ACS_SSSB, ACS_SSSS, ACS_STERLING, ACS_TTEE, ACS_UARROW, ACS_ULCORNER,
    ACS_URCORNER, ACS_VLINE,
};
pub use pancurses::{
    ALL_MOUSE_EVENTS, A_ALTCHARSET, A_ATTRIBUTES, A_BLINK, A_BOLD, A_CHARTEXT, A_COLOR, A_DIM,
    A_INVIS, A_ITALIC, A_LEFTLINE, A_NORMAL, A_OVERLINE, A_REVERSE, A_RIGHTLINE, A_STANDOUT,
    A_STRIKEOUT, A_UNDERLINE, BUTTON1_CLICKED, BUTTON1_DOUBLE_CLICKED, BUTTON1_PRESSED,
    BUTTON1_RELEASED, BUTTON1_TRIPLE_CLICKED, BUTTON2_CLICKED, BUTTON2_DOUBLE_CLICKED,
    BUTTON2_PRESSED, BUTTON2_RELEASED, BUTTON2_TRIPLE_CLICKED, BUTTON3_CLICKED,
    BUTTON3_DOUBLE_CLICKED, BUTTON3_PRESSED, BUTTON3_RELEASED, BUTTON3_TRIPLE_CLICKED,
    BUTTON4_CLICKED, BUTTON4_DOUBLE_CLICKED, BUTTON4_PRESSED, BUTTON4_RELEASED,
    BUTTON4_TRIPLE_CLICKED, BUTTON5_CLICKED, BUTTON5_DOUBLE_CLICKED, BUTTON5_PRESSED,
    BUTTON5_RELEASED, BUTTON5_TRIPLE_CLICKED, BUTTON_ALT, BUTTON_CTRL, BUTTON_SHIFT, COLOR_BLACK,
    COLOR_BLUE, COLOR_CYAN, COLOR_GREEN, COLOR_MAGENTA, COLOR_RED, COLOR_WHITE, COLOR_YELLOW, ERR,
    KEY_EVENT, KEY_F15, KEY_OFFSET, KEY_RESIZE, OK, REPORT_MOUSE_POSITION, SPECIAL_KEY_CODES,
};
pub type Chtype = pancurses::chtype;
pub type MouseMask = pancurses::mmask_t;
pub type MouseEvent = pancurses::MEVENT;

pub(crate) fn check(r: i32) -> Result<(), ()> {
    if r == pancurses::ERR {
        Err(())
    } else {
        Ok(())
    }
}

use std::time::Duration;
pub(crate) fn as_millis(duration: Duration) -> i32 {
    duration.as_secs() as i32 * 1000 + duration.subsec_millis() as i32
}
