Beispiel #1
0
void
inp_win_clear(void)
{
    werase(inp_win);
    wmove(inp_win, 0, 0);
    pad_start = 0;
    _inp_win_update_virtual();
}
Beispiel #2
0
static void
_inp_write(char *line, int offset)
{
    int col = _inp_offset_to_col(line, offset);
    werase(inp_win);
    waddstr(inp_win, line);
    wmove(inp_win, 0, col);
    _inp_win_handle_scroll();

    _inp_win_update_virtual();
}
Beispiel #3
0
char*
inp_get_line(void)
{
    werase(inp_win);
    wmove(inp_win, 0, 0);
    _inp_win_update_virtual();
    doupdate();
    char *line = NULL;
    while (!line) {
        line = inp_readline();
        ui_update();
    }
    status_bar_clear();
    return line;
}
Beispiel #4
0
char*
inp_get_password(void)
{
    werase(inp_win);
    wmove(inp_win, 0, 0);
    pad_start = 0;
    _inp_win_update_virtual();
    doupdate();
    char *password = NULL;
    get_password = TRUE;
    while (!password) {
        password = inp_readline();
    }
    get_password = FALSE;
    status_bar_clear();
    return password;
}
Beispiel #5
0
void
inp_win_resize(void)
{
    int col = getcurx(inp_win);
    int wcols = getmaxx(stdscr);

    // if lost cursor off screen, move contents to show it
    if (col >= pad_start + wcols) {
        pad_start = col - (wcols / 2);
        if (pad_start < 0) {
            pad_start = 0;
        }
    }

    wbkgd(inp_win, theme_attrs(THEME_INPUT_TEXT));;
    _inp_win_update_virtual();
}
Beispiel #6
0
void
create_input_window(void)
{
#ifdef NCURSES_REENTRANT
    set_escdelay(25);
#else
    ESCDELAY = 25;
#endif
    rl_readline_name = "profanity";
    rl_getc_function = _inp_rl_getc;
    rl_startup_hook = _inp_rl_startup_hook;
    rl_callback_handler_install(NULL, _inp_rl_linehandler);

    inp_win = newpad(1, INP_WIN_MAX);
    wbkgd(inp_win, theme_attrs(THEME_INPUT_TEXT));;
    keypad(inp_win, TRUE);
    wmove(inp_win, 0, 0);

    _inp_win_update_virtual();
}
Beispiel #7
0
void
inp_put_back(void)
{
    _inp_win_update_virtual();
}